#3
feat: add fetch hook to add custom user agent
In our CLI, we want to inject request metadata (such as use agent strings / headers), without patching global fetch, which can become ugly.
therefore, we:
- add
fetch?: typeof fetchtomain() - thread fetch through
addGeneratedCommandsintoexecuteAction, so generated CLI commands use the provided fetch implementation. - add a test to validate that the fetch is honoured
NOTE: this PR includes my previous PR, let me know if i shall separate because one should be merged before the other. thanks!