Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npx command to setup default config #739

Closed
2 tasks done
Tracked by #322
grizlizli opened this issue Jul 10, 2024 · 4 comments
Closed
2 tasks done
Tracked by #322

Npx command to setup default config #739

grizlizli opened this issue Jul 10, 2024 · 4 comments
Assignees
Labels
🧩 cli ➕ enhancement new feature or request 🧩 nx-plugin 🛠️ tooling 🤓 UX UX improvement for CLI users

Comments

@grizlizli
Copy link

grizlizli commented Jul 10, 2024

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

  • extend the ext to accept a ext options to specify the file extension.
  • auto detect typescript and take ts if given. otherwise take mjs as extension.

Implementation details

Generate a config file in the root of the project.

@vmasek vmasek added 📖 Project documentation improvements or additions to the project documentation and removed 📖 Project documentation improvements or additions to the project documentation labels Jul 11, 2024
@vmasek
Copy link
Collaborator

vmasek commented Jul 11, 2024

@BioPhoton Please finalize the issue for refinement

@BioPhoton BioPhoton added ➕ enhancement new feature or request 🧩 cli labels Jul 18, 2024
@BioPhoton
Copy link
Collaborator

BioPhoton commented Jul 23, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

Updated issue and started work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧩 cli ➕ enhancement new feature or request 🧩 nx-plugin 🛠️ tooling 🤓 UX UX improvement for CLI users
Projects
None yet
Development

No branches or pull requests

4 participants