Skip to content

🔧 Repository: Missing name Field in thepackage.json file for a newly generated plugin #6047

@elaine-mattos

Description

@elaine-mattos

📜 Description

When generating a new frontend plugin using yarn new, linting fails because the generated package.json is missing the required "name" field.

👍 Expected behavior

The created plugin should include a valid "name" field and pass linting.

👎 Current Behavior

Linting fails with:

my-awesome-workspace git:(main) ✗ yarn new
? What do you want to create? frontend-plugin - A new frontend plugin
? Enter the ID of the plugin [required] my-awesome-plugin
  templating    plugins/my-awesome-plugin ✔
  executing     yarn install ✔
  executing     yarn lint --fix ✖

Error: Error while loading rule '@backstage/no-forbidden-package-imports': The following package.jsons are missing the "name" field:
plugins/my-awesome-plugin/package.json
Occurred while linting ~/community-plugins/workspaces/my-awesome-workspace/plugins/my-awesome-plugin/dev/index.tsx

Warning: Failed to execute command yarn lint --fix

👟 Reproduction steps

Create a new workspace, eg "my-awesome-workspace":

yarn create-workspace
yarn install
cd workspaces/my-awesome-workspace

Create a new frontend plugin:

my-awesome-workspace git:(main) ✗ yarn new
? What do you want to create? frontend-plugin - A new frontend plugin
? Enter the ID of the plugin [required] my-awesome-plugin
  templating    plugins/my-awesome-plugin ✔
  executing     yarn install ✔
  executing     yarn lint --fix ✖

📃 Provide the context for the Bug.

I am trying to make it easier for the developers in our organization to create plugins for us. As we don't want to see our own codebase bloated with different plugins from different teams we have decided to offer scaffolder templates that would give the teams a minimal repo that they could use to start their plugins.
In order to find out how such a repo should look like we decided to take a look at the CONTRIBUTING documentation and we found some issues.

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

No, but I'm happy to collaborate on a PR with someone else

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions