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 NP plugin boilerplate script #52752

Closed

Conversation

lizozom
Copy link
Contributor

@lizozom lizozom commented Dec 11, 2019

Summary

Added an option to the yarn kbn script to create plugin boiler plate code.

yarn kbn plugin new_plugin --ui --server (It's possible to set only one option, but at least one is mandatory)

This command will create a new plugin (unless a plugin with that name already exists) having the following structure:

new_plugin

  • common
    • index.ts
  • public (if --ui is set)
    • index.ts
    • types.ts
    • plugins.ts
  • server (if --server is set)
    • index.ts
    • plugin.ts
  • kibana.json
  • README.md

It also adds the plugin to i18nrc.json

If the script fails to initialize the plugin, it attempts to perform cleanup.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@lizozom lizozom added Team:Operations Team label for Operations Team release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. v8.0.0 Feature:NP Migration v7.6.0 labels Dec 11, 2019
@lizozom lizozom requested review from a team as code owners December 11, 2019 14:50
@lizozom lizozom self-assigned this Dec 11, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@lizozom lizozom requested a review from a team December 11, 2019 14:51
@joshdover
Copy link
Contributor

Seems like a lot of overlap between this and the plugin generator in packages/kbn-plugin-generator. That package has not been updated for New Platform plugins though and is a bit more targetted to 3rd party development.

@lizozom what do you think about updating the existing generator?

@lizozom lizozom force-pushed the newplatform/kbn-pm/create-plugin branch from 824bfd1 to 1ec739f Compare December 11, 2019 16:17
@elasticmachine
Copy link
Contributor

💔 Build Failed

History

  • 💔 Build #14802 failed 824bfd15b5a5478cc7ef47dd00d858ea9f300d25

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@lukeelmers
Copy link
Member

+1 for considering an update to the existing generator, especially since historically we've documented it as the recommended way to bootstrap a new plugin.

On another note - whichever route we go, we should also be sure everything aligns with our CONVENTIONS.md to prevent confusion.

@lizozom
Copy link
Contributor Author

lizozom commented Dec 12, 2019

@joshdover @lukeelmers - will move the code over there

@lizozom
Copy link
Contributor Author

lizozom commented Jan 19, 2020

Replaced by #55281

@lizozom lizozom closed this Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Operations Team label for Operations Team v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants