cli
cli copied to clipboard
Npx command to setup default config
User story
As a developer, I would like to setup the CLI as easy as possible.
Running the command such as npx code-pushup init should create code-pushup.config.[ ts | js | mjs ] file.
init command should have arguments for file extension, default ts.
Acceptance criteria
Running the above mentioned command should generate the config file in the project.
Add package create-cli:
- [x] create
create-clipackage to enable thenpx init @code-pushup/clicommand. The init command translates tonpm exec @code-pushup/create-cli.
#779 - [x] create init script that is able to reuse the
nx-pluginlogic
Extend nx-plugin
- [ ] extend the
extto accept aextoptions to specify the file extension. - [ ] auto detect typescript and take
tsif given. otherwise takemjsas extension.
Implementation details
Generate a config file in the root of the project.
@BioPhoton Please finalize the issue for refinement
As this has quite a decent overlap with the nx generators we could do the following:
npm init @code-pushup/cli->npm exec @code-pushup/create-cli- create a publishable package
create-cli - inside use
nx g @code-pushup/nx-plugin:configuration -
- I have to figure out how to execute the generator without a nx.json prelent.
@matejchalk WDYT?
As this has quite a decent overlap with the nx generators we could do the following:
npm init @code-pushup/cli->npm exec @code-pushup/create-cli- create a publishable package
create-cli- inside use
nx g @code-pushup/nx-plugin:configuration2.1. I have to figure out how to execute the generator without a nx.json prelsent.
Yes! Having a create- package would give us compatibility with non-Nx codebases, since this package initializer format is supported by NPM, PNPM and Yarn 1.
Updated issue and started work.