cli
cli copied to clipboard
nx plugin - `cli` executor for the code pushup CLI
User story
As a user of Nx I want to have convenient configuration of my code-pushup related target. A custom executor for the code-pushup CLI would reduce configuration and setup cost.
Acceptance criteria
- [x] #737
- [ ] forward
stdoutandstderrfrom CLI process in executor - #740
- [x] create a
zodschemaenvSchemato parse environment variables
- [x] create a
- [x] ~bundle package in multiple formats - https://nx.dev/recipes/tips-n-tricks/compile-multiple-formats~
- https://github.com/nrwl/nx/issues/15682#issuecomment-1700298264
- (possible alternative) https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/ 👀
- generate a
schema.jsonfrom azodschema inschema.ts(optional)
Dual Build
Problems regarding the dual build:
- @poppinss/cliui also doesn't support CJS for some time. Possible workaround for @poppinss/cliui would be a dynamic import
- non-CJS-compatible runtime dependencies are lighthouse and lighthouse-logger
- big refactoring as turning all functions async that touch one of the incompatible tools
Conclusion use the CLI in a separate process instead and duplicate some of the logic.
Implementation details
https://github.com/code-pushup/cli/tree/add-executor-to-nx-plugin