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

[V5] Plugin CLI #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[V5] Plugin CLI #55

wants to merge 1 commit into from

Conversation

joshuaellis
Copy link

Introduce a dedicated plugin CLI to assist developers in creating plugins for strapi the right way easily

You can read it here

@joshuaellis joshuaellis added the v5 label Sep 8, 2023
@joshuaellis joshuaellis self-assigned this Sep 8, 2023
@joshuaellis joshuaellis changed the title feat: add plugin-cli RFC [V5] Plugin CLI Sep 8, 2023
@ComfortablyCoding
Copy link

Posting here from discord per request from joshua.

This looks great!

Suggestions

One additional command that I would suggest is a db migration generation one. Enabling devs to generate knex migrations that will be picked up and executed at boot.

Questions

For me the last major pains for plugins are:

  1. Testing
    • When trying to test manually I need to install and have it within a strapi application which is not ideal, is it possible we would be able to do some sort of playground like nuxt modules can do? Is this what the link command is for?
    • Automated tests (both front-end and back-end) are not easily done. I assume that's why most plugins do not have any.
    • When testing the admin the errors are not descriptive or easy to find as build is awlays for prod.
  2. Extensibility of core
    • A lot of internal but useful things (utils, components, hooks etc) are not exported and easily consumable by a plugin. It forces the devs to re-implement duplicate logic.

Any chance these are being addressed/looked into as well?

@joshuaellis
Copy link
Author

Thanks for the feedback @ComfortablyCoding.

Testing

the link command should easy the ability for testing as you can use your local plugin as if it were installed in a strapi app, your set up could look like:

my-plugin/
├─ demo/
├─ src/
│  ├─ index.ts
├─ package.json

Where demo is a local strapi app – alternatively if you're building a plugin for your strapi app you could link it anywhere on your pc – we'll be using yalc to facilitate this. RE. automated testing, I agree, it's not easy to test strapi-fe at the moment externally unless you have a lot of deep knowledge. From the work we're doing in V5 a small ambition is to export some test utils either from the admin-package or elsewhere so you have a testing harness e.g. a store built etc. Finally regarding the build, we're aware the source-maps don't exist and are not ideal, this is something else we want to address 😄

Extensibility of Core

It'd be great to understand what you feel you're missing on this side so we can look into providing these exports. I think the naming conventions in the codebase at the moment are not very user friendly and i'd like to look at exporting more for users with clear names and guides.

@ComfortablyCoding
Copy link

ComfortablyCoding commented Sep 12, 2023

Nice, hopefully that resolves some issues.

In terms of the extensibility of the code it was more for the admin panel than the design system I guess. Technically unrelated here.

In terms of the design system their are common UI interfaces missing from the design system but present else where. For example the components exported from the helper plugin.

Possibly already addressed by strapi/design-system#1269.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants