You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Adoption of RunnerConfig with outputDir derived from PersistConfig #227
This will make it easier to work with different cwd and config location settings. npx ../../dist/packages/cli collect --config=../../packages/cli/test/plugin-progress-bar.config.mock.ts --outputDir=../../tmp
how would you implement this without confusing code or user :)
Let me know you thought, I started and realised it is not trivial :D
I'm not sure I understand the motivation (it's been a while, so maybe I don't remember) 😕
The runner output is specified by the plugin author, is only intermediate and also there's in general more than one and each can use a different location (multiple plugins, potentially different authors). While the output directory is specified by the end-user (quite likely not the same person as plugin author) and is intended to be read (markdown) or used (json for upload) afterwards.
I don't really see those locations as logically linked in most situations. And I think it would be confusing to resolve relative paths in different ways. I think the relative paths should either all stay relative CWD, or should be relative to the config file which specified them (but then we would have to differentiate paths specified with CLI arg, because there you'd expect CWD - yeah, probably that's also confusing).
For the locations we have, I see them being used like this:
config
usually in root, sometimes in project dir for cross-team/multi-product monorepos
included in version control
written (perhaps initially generated) and maintained by user
typical example: ./code-pushup.config.ts
persist.outputDir
relevant to user, will check those outputs at least first time
not included in version control
typical example: .code-pushup/report.json, .code-pushup/report.md (.code-pushup/ added to .gitignore)
Activity
BioPhoton commentedon Nov 10, 2023
@matejchalk how would you implement this without confusing code or user :)
Let me know you thought, I started and realised it is not trivial :D
matejchalk commentedon Nov 11, 2023
I'm not sure I understand the motivation (it's been a while, so maybe I don't remember) 😕
The runner output is specified by the plugin author, is only intermediate and also there's in general more than one and each can use a different location (multiple plugins, potentially different authors). While the output directory is specified by the end-user (quite likely not the same person as plugin author) and is intended to be read (markdown) or used (json for upload) afterwards.
I don't really see those locations as logically linked in most situations. And I think it would be confusing to resolve relative paths in different ways. I think the relative paths should either all stay relative CWD, or should be relative to the config file which specified them (but then we would have to differentiate paths specified with CLI arg, because there you'd expect CWD - yeah, probably that's also confusing).
For the locations we have, I see them being used like this:
config./code-pushup.config.tspersist.outputDir.code-pushup/report.json,.code-pushup/report.md(.code-pushup/added to.gitignore)plugins[].runner.outputFilerunnerfunction supported (Enhance DX of plugin authors #92), probably not relevant for small custom plugins eithernode_modules/.code-pushup/eslint/runner-output.jsonI see all those purposes as fairly independent, so resolving them relative to each other would probably only cause confusion and complicate things.
Am I missing something?
BioPhoton commentedon Nov 12, 2023
Love it! Will close the part and link this in #92