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

💡 [Feature]: extend CLI command logs with full name and options passed #283

Closed
Adam-it opened this issue Jul 28, 2024 · 5 comments
Closed
Assignees
Labels
⭐ enhancement New feature or request 💪 good first issue Good for newcomers hacktoberfest 👨‍💻work in progress I am working on it
Milestone

Comments

@Adam-it
Copy link
Contributor

Adam-it commented Jul 28, 2024

🎯 Aim of the feature

Currently the logs for CLI commands are quite short
image

we are missing the m365 before every command and we do not print out the passed options that were used to run this command. This does not help as the actually idea behind this functionality was to provide guidance for developers what are the CLI commands that may use as equivalent to the SPFx Toolkit feature if they would rather use a terminal instead.

We should fix it up.
In order to do that we should recheck the tryExecuteCommand method in
https://github.com/pnp/vscode-viva/blob/main/src/services/CliCommandExecuter.ts

image

We should add:

  • m365 for every command
  • print the passed args which will be the options used
  • double check the output default value which is text. IMO it should be always json and we could then remove passing it in all places
@Adam-it Adam-it added ⭐ enhancement New feature or request 💪 good first issue Good for newcomers 🙏 help wanted Open for contributors labels Jul 28, 2024
@Adam-it Adam-it added this to the v3.X milestone Jul 28, 2024
@Adam-it Adam-it added the 🤚 on hold I need to wait for something else label Sep 7, 2024
@Adam-it
Copy link
Contributor Author

Adam-it commented Sep 7, 2024

lets keep this on hold until this issue is resolved #295

@Adam-it Adam-it modified the milestones: v3.X, v4.X Sep 8, 2024
@Adam-it Adam-it added hacktoberfest and removed 🤚 on hold I need to wait for something else labels Sep 24, 2024
@Adam-it
Copy link
Contributor Author

Adam-it commented Sep 24, 2024

lets keep this on hold until this issue is resolved #295

lets not care about it. We may always document that we are using older version of CLI under the hood

@DevPio
Copy link
Contributor

DevPio commented Sep 24, 2024

I would like to work on this problem

@Adam-it Adam-it added 👨‍💻work in progress I am working on it and removed 🙏 help wanted Open for contributors labels Sep 24, 2024
@Adam-it
Copy link
Contributor Author

Adam-it commented Sep 24, 2024

I would like to work on this problem

All yours.
Please keep in mind this issue participates in Hacktoberfest event so if you want this PR to count towards this event please be sure to open the PR during October (not sooner and not later 👍)

Adam-it pushed a commit that referenced this issue Oct 4, 2024
…313)

## 🎯 Aim

Adding the m365 prefix: The m365 prefix is now included before every CLI
command, ensuring that the logged commands accurately reflect what is
run in the terminal.

Logging CLI command options: The PR also includes the functionality to
log the options passed with each command, providing better transparency
and guidance for developers who want to understand the equivalent
terminal commands for SPFx Toolkit features.

However, the functionality to set json as the default output for all
commands was not implemented, as there are parts of the code that use
other output formats, such as md (Markdown). Changing the default output
to json globally could break those functionalities.

![image](https://github.com/user-attachments/assets/61a93e6a-712f-4122-82fb-f00ae3ce18b7)

## 📷 Result

![Captura de tela 2024-09-30
124116](https://github.com/user-attachments/assets/0dce5b35-2022-4e54-980a-4c318441282f)

![Captura de tela 2024-09-30
124152](https://github.com/user-attachments/assets/eb01d647-8580-4677-912a-ea6af1ae10d2)

## 🔗 Related issue


Closes: #283
@Adam-it
Copy link
Contributor Author

Adam-it commented Oct 4, 2024

PR merged.
A new pre-release with this enhancement should be live shortly 👍

@Adam-it Adam-it closed this as completed Oct 4, 2024
Adam-it pushed a commit that referenced this issue Oct 19, 2024
…313)

## 🎯 Aim

Adding the m365 prefix: The m365 prefix is now included before every CLI
command, ensuring that the logged commands accurately reflect what is
run in the terminal.

Logging CLI command options: The PR also includes the functionality to
log the options passed with each command, providing better transparency
and guidance for developers who want to understand the equivalent
terminal commands for SPFx Toolkit features.

However, the functionality to set json as the default output for all
commands was not implemented, as there are parts of the code that use
other output formats, such as md (Markdown). Changing the default output
to json globally could break those functionalities.

![image](https://github.com/user-attachments/assets/61a93e6a-712f-4122-82fb-f00ae3ce18b7)

## 📷 Result

![Captura de tela 2024-09-30
124116](https://github.com/user-attachments/assets/0dce5b35-2022-4e54-980a-4c318441282f)

![Captura de tela 2024-09-30
124152](https://github.com/user-attachments/assets/eb01d647-8580-4677-912a-ea6af1ae10d2)

## 🔗 Related issue


Closes: #283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement New feature or request 💪 good first issue Good for newcomers hacktoberfest 👨‍💻work in progress I am working on it
Projects
None yet
Development

No branches or pull requests

2 participants