code-pushup / cli

A CLI to run all kinds of code quality measurements to align your team with company goals
https://code-pushup.dev
MIT License
188 stars 11 forks source link

Npx command to setup default config #739

Closed grizlizli closed 5 days ago

grizlizli commented 1 month ago

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:

Extend nx-plugin

Implementation details

Generate a config file in the root of the project.

vmasek commented 1 month ago

@BioPhoton Please finalize the issue for refinement

BioPhoton commented 1 month ago

As this has quite a decent overlap with the nx generators we could do the following:

  1. npm init @code-pushup/cli -> npm exec @code-pushup/create-cli
  2. create a publishable package create-cli
  3. inside use nx g @code-pushup/nx-plugin:configuration
    1. I have to figure out how to execute the generator without a nx.json prelent.

    @matejchalk WDYT?

matejchalk commented 1 month ago

As this has quite a decent overlap with the nx generators we could do the following:

  1. npm init @code-pushup/cli -> npm exec @code-pushup/create-cli
  2. create a publishable package create-cli
  3. inside use nx g @code-pushup/nx-plugin:configuration 2.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.

BioPhoton commented 3 weeks ago

Updated issue and started work.