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

[feat]: Detect when running command inside of project and ask to use plugins directory #22

Closed
derrickmehaffy opened this issue Jun 7, 2024 · 1 comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@derrickmehaffy
Copy link
Member

A clear and concise description of what the feature is

When running the command inside of a Strapi project (npx @strapi/sdk-plugin@latest init test) it will create the plugin at the base directory instead of ./src/plugins.

Likewise it does not provide the user the information to set within the ./config/plugins.js|.ts file

Why should this feature be included?

Make it easier for new users to start developing plugins by providing contextual help to place the plugin in the proper directory and provide hints to enable the plugin making it easier to start testing the plugin

Please provide an example for how this would work

Just some thoughts but look for the following information:

  • Check if package.json exists and if it contains the @strapi/strapi dependency (might be good to check version as well)
  • Check if ./src exists and if it does check if ./src/plugins exists, if not create the plugins directory but if no ./src is detected this might be a monorepo and default to current logic
  • Once the package.json check and the ./src/plugins exists, create the package in that directory and likewise provide a hint in the CLI output on how to enable the plugin.
@innerdvations
Copy link
Collaborator

Implemented in #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
Archived in project
Development

No branches or pull requests

2 participants