Skip to content

Create NP plugin boilerplate script#52752

Closed
lizozom wants to merge 3 commits intoelastic:masterfrom
lizozom:newplatform/kbn-pm/create-plugin
Closed

Create NP plugin boilerplate script#52752
lizozom wants to merge 3 commits intoelastic:masterfrom
lizozom:newplatform/kbn-pm/create-plugin

Conversation

@lizozom
Copy link
Copy Markdown
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 Kibana-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
Copy Markdown
Contributor

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

@lizozom lizozom requested a review from a team December 11, 2019 14:51
@joshdover
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

+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
Copy Markdown
Contributor Author

lizozom commented Dec 12, 2019

@joshdover @lukeelmers - will move the code over there

@lizozom
Copy link
Copy Markdown
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 Kibana-Operations Team v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants