Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Refactor config into virtual modules
Merged did:key:z6MkkfM3...sVz5 opened 1 year ago

This patch moves the config files into a new config folder, this allows the new config package to detect it and based on a priority list and compute a final config. The final config is provided to the app via virtual modules that are created on build time and provided to the app during run time.

We define also a new NODE_CONFIG_ENV env variable which is used by the config package to overwrite certain parts of the config for e.g. testing. This allows us also to clean up any config changes we do in the test suites and have everything in the same place, aka the config dir.

Also since this new env var removes the need for window.PLAYWRIGHT and window.VITEST, I went the extra step and was able to remove all the injections into the window object we did, which is just cleaner. Added additionally a custom-environment-variables.json mapping file which defines env vars for each of the config options. Some are pretty straight forward, others require to serialize the values into a json string to be parsed.

The error behavior is pretty gracefully and in all cases always fallback to our default.json file instead of throwing build or run time errors.

check check-visual check-unit-test check-httpd-api-unit-test check-e2e check-build

👉 Preview 👉 Workflow runs 👉 Branch on GitHub

did:key:z6MkkfM3...sVz5 opened with revision a2558544 on base 8c069387 +138 -193 1 year ago

This patch moves the config files into a new config folder, this allows the new config package to detect it and based on a priority list and compute a final config. The final config is provided to the app via virtual modules that are created on build time and provided to the app during run time.

We define also a new NODE_CONFIG_ENV env variable which is used by the config package to overwrite certain parts of the config for e.g. testing. This allows us also to clean up any config changes we do in the test suites and have everything in the same place, aka the config dir.

Also since this new env var removes the need for window.PLAYWRIGHT and window.VITEST, I went the extra step and was able to remove all the injections into the window object we did, which is just cleaner. Added additionally a custom-environment-variables.json mapping file which defines env vars for each of the config options. Some are pretty straight forward, others require to serialize the values into a json string to be parsed.

The error behavior is pretty gracefully and in all cases always fallback to our default.json file instead of throwing build or run time errors.

check check-visual check-unit-test check-httpd-api-unit-test check-e2e check-build

👉 Preview 👉 Workflow runs 👉 Branch on GitHub

did:key:z6MkkfM3...sVz5 pushed revision 2 96bf9986 on base 0e059bf3 +221 -308 1 year ago

Separate into more atomic commits and make tests work

did:key:z6MkkfM3...sVz5 pushed revision 3 59684fef on base 0e059bf3 +245 -308 1 year ago

Added custom environment variable matcher to allow individual env variables

did:key:z6MkkfM3...sVz5 pushed revision 4 0f6709d4 on base 0e059bf3 +246 -308 1 year ago

Create a symlink to make it clear which config our production deployment uses

did:key:z6MkkfM3...sVz5 pushed revision 5 0ab19d43 on base 0e059bf3 +264 -308 1 year ago

Add a configure section to the README

did:key:z6MkkfM3...sVz5 pushed revision 6 596ee1e8 on base 0e059bf3 +263 -308 1 year ago

Rename module.d.ts declaration

did:key:z6MkkfM3...sVz5 pushed revision 7 9a385247 on base ce8d6f6d +263 -308 1 year ago

Rebase on top of responsive changes

did:key:z6MkkfM3...sVz5 pushed revision 8 676873af on base ce8d6f6d +267 -308 1 year ago

Rewrite README configuration section and add local config files to gitignore

did:key:z6MkkfM3...sVz5 pushed revision 9 33ce235b on base ce8d6f6d +266 -308 1 year ago

Remove module.d.ts comment

rudolfs accepted 1 year ago
rudolfs merged revision 33ce235b at 15e258da 1 year ago