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

Do not generate or ask to generate a backend in panel plugins #89

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

academo
Copy link
Member

@academo academo commented Oct 20, 2022

Fixes #84

  • It stops asking the user if they want to generate a backend for panel plugin. This was generating some backend code but not the correct plugin.json. Nevertheless we don't support panel plugins with backend.
  • It changes the internal tools generate-(panel|datasource|app) to use node-plop directly instead of using the plopjs way to bypass cli arguments. This due to plopjs not being able to handle conditional inputs from the CLI args.

@academo academo requested a review from jackw October 20, 2022 13:09
@academo academo self-assigned this Oct 20, 2022
@academo academo added the enhancement New feature or request label Oct 20, 2022
@academo academo added this to the v1.0.0 milestone Oct 20, 2022
@@ -0,0 +1,24 @@
const nodePlop = require('node-plop');
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that I decided to copy-paste the scripts rather than trying to abstract common parts into a separate function to keep them simple and clear.

One could think of a single-script that handle CLI arguments but that will require a far more complex logic that we will later have to maintain and understand so I decided against.

@@ -69,6 +69,7 @@ export default function (plop: NodePlopAPI) {
type: 'confirm',
message: 'Do you want a backend part of your plugin?',
default: false,
when: (answers: CliArgs) => answers.pluginType !== PLUGIN_TYPES.panel,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the important change in the generator part.

Copy link
Collaborator

@jackw jackw left a comment

Choose a reason for hiding this comment

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

LGTM!

@academo academo merged commit 238c052 into main Oct 20, 2022
@academo academo deleted the panels-dont-use-backend branch October 20, 2022 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Do not prompt to generate nor generate backend for panel plugins.
2 participants