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

Create-Plugin: Simplify Prompts #1018

Merged
merged 15 commits into from
Jul 31, 2024
Merged

Conversation

jackw
Copy link
Collaborator

@jackw jackw commented Jul 18, 2024

What this PR does / why we need it:

This PR makes the following changes:

  • Moves plugin type question to start as more logical and important starting point
  • Adds basic descriptors for plugin types to make clearer on purpose/use case for each
  • Gives indication of why a backend component might be needed
  • Removes (3) prompts to simplify and shorten interaction: description, CI/Release actions and levitate action.
  • Shortens basic prompts language
  • Removes output of each generated file as this offers no value and clutters the terminal
  • Adds new success messages to indicate presence of e2e tests and GH actions, slight rewording for others

Whilst we don't believe anyone is using the cliArgs (other than ourselves) to set prompt answers I've nonetheless set this as a major breaking change due to the removal of the workflow related cliArgs.

Which issue(s) this PR fixes:

Fixes #995

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/create-plugin@5.0.0-canary.1018.f1b5b46.0
# or 
yarn add @grafana/create-plugin@5.0.0-canary.1018.f1b5b46.0

@jackw jackw added create-plugin related to the create-plugin tool major Increment the major version when merged release Create a release when this pr is merged labels Jul 18, 2024
@jackw jackw self-assigned this Jul 18, 2024
Copy link

github-actions bot commented Jul 18, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new major release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

@jackw jackw marked this pull request as ready for review July 19, 2024 12:07
@jackw jackw requested a review from a team as a code owner July 19, 2024 12:07
@jackw jackw requested review from oshirohugo, academo, leventebalogh and sympatheticmoose and removed request for a team July 19, 2024 12:07
Copy link
Collaborator

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

@sympatheticmoose sympatheticmoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! A few comments for now - I just want to try a couple of manual tests as well

@@ -53,22 +53,22 @@ jobs:
matrix:
include:
- workingDir: 'myorg-nobackend-app'
cmd: create-plugin --pluginName='no-backend' --orgName='myorg' --pluginDescription='This is a sample app.' --pluginType='app' --no-hasBackend --hasGithubWorkflows --hasGithubLevitateWorkflow
cmd: create-plugin --pluginName='no-backend' --orgName='myorg' --pluginType='app' --no-hasBackend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incredibly nitty comment which you are welcome to resolve as "go away David" - but maybe cleaner if the args are in the same order as the prompts

hasBackend: true
- workingDir: 'myorg-nobackendscenes-app'
cmd: create-plugin --pluginName='no-backend-scenes' --orgName='myorg' --pluginDescription='This is a sample scenes app.' --pluginType='scenesapp' --no-hasBackend --hasGithubWorkflows --hasGithubLevitateWorkflow
cmd: create-plugin --pluginName='no-backend-scenes' --orgName='myorg' --pluginType='scenesapp' --no-hasBackend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing scenes with backend?

"generate-datasource": "tsc && npm run clean-generated && CREATE_PLUGIN_DEV=true node ./dist/bin/run.js --pluginName='Sample datasource' --orgName='sample-org' --pluginDescription='This is a sample datasource.' --pluginType='datasource' --no-hasBackend --hasGithubWorkflows --hasGithubLevitateWorkflow",
"generate-datasource-backend": "tsc && npm run clean-generated && CREATE_PLUGIN_DEV=true node ./dist/bin/run.js --pluginName='Sample datasource' --orgName='sample-org' --pluginDescription='This is a sample datasource.' --pluginType='datasource' --hasBackend --hasGithubWorkflows --hasGithubLevitateWorkflow",
"generate-app": "tsc && npm run clean-generated && CREATE_PLUGIN_DEV=true node ./dist/bin/run.js --pluginName='Sample app' --orgName='sample-org' --pluginType='app' --no-hasBackend",
"generate-scenes-app": "tsc && npm run clean-generated && CREATE_PLUGIN_DEV=true node ./dist/bin/run.js --pluginName='Sample scenesapp' --orgName='sample-org' --pluginType='scenesapp' --no-hasBackend",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing scenes backend option?

packages/create-plugin/src/commands/generate.command.ts Outdated Show resolved Hide resolved
packages/create-plugin/src/commands/generate.command.ts Outdated Show resolved Hide resolved
jackw and others added 2 commits July 22, 2024 16:04
Co-authored-by: David Harris <david.harris@grafana.com>
Copy link
Contributor

@sympatheticmoose sympatheticmoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

packages/create-plugin/src/commands/generate.command.ts Outdated Show resolved Hide resolved
@tomglenn
Copy link
Contributor

The new flow is much more streamlined, looking forward to this being merged. Nice work!

Co-authored-by: David Harris <david.harris@grafana.com>
@sympatheticmoose sympatheticmoose merged commit 8358479 into main Jul 31, 2024
13 checks passed
@sympatheticmoose sympatheticmoose deleted the jackw/cp-simplify-prompts branch July 31, 2024 12:16
@grafana-plugins-platform-bot
Copy link

🚀 PR was released in @grafana/create-plugin@5.0.0 🚀

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot added the released This issue/pull request has been released. label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-plugin related to the create-plugin tool major Increment the major version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
Development

Successfully merging this pull request may close these issues.

Simplify prompts for create-plugin
4 participants