#Migrating backstage plugin to community-plugins repositoy

24 messages · Page 1 of 1 (latest)

deep blade
#

Hello, I am trying to migrate by backstage plugin into the Backstage/community-plugins repository using this. I'm running into an error when I'm committing the files. This is what I'm currently getting:

⚠ Running tasks for staged files...
  ❯ workspaces/acs/package.json — 67 files
    ❯ *.{js,jsx,ts,tsx,mjs,cjs} — 37 files
      ✖ eslint --fix [FAILED]
      ◼ prettier --write
    ✔ *.{json,md} — 14 files
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Command failed: yarn add @backstage/plugin-catalog-react@^1.13.0
Occurred while linting /home/mknop/repos/community-plugins/workspaces/acs/plugins/acs/src/components/ACSComponent/ACSComponent.tsx:16
Rule: "@backstage/no-undeclared-imports"
    at checkExecSyncError (node:child_process:890:11)
    at execFileSync (node:child_process:926:15)
    at addMissingImports (/home/mknop/repos/community-plugins/workspaces/acs/node_modules/@backstage/eslint-plugin/rules/no-undeclared-imports.js:189:5)
    at Program:exit (/home/mknop/repos/community-plugins/workspaces/acs/node_modules/@backstage/eslint-plugin/rules/no-undeclared-imports.js:320:11)
    at ruleErrorHandler (/home/mknop/repos/community-plugins/workspaces/acs/node_modules/eslint/lib/linter/linter.js:1076:28)
    at /home/mknop/repos/community-plugins/workspaces/acs/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/mknop/repos/community-plugins/workspaces/acs/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/mknop/repos/community-plugins/workspaces/acs/node_modules/eslint/lib/linter/node-event-generator.js:297:26)

What am I doing wrong here that this wont work? The plugin works using the old repository that I was housing this in. It's in a Backstage monorepo.

GitHub

Community plugins for Backstage. Contribute to backstage/community-plugins development by creating an account on GitHub.

shy needle
#

Hi @deep blade, I'll try and help. We might be enforcing stricter rules than it's current location. I'd probably focus on why the @backstage/no-undeclared-imports is failing. Is there any other details about why the yarn add failed? That also could help.

deep blade
#

Beyond that is this:

#
➤ YN0032: │ better-sqlite3@npm:9.6.0: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ better-sqlite3@npm:11.8.1: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ xterm-addon-fit@npm:0.8.0 is deprecated: This package is now deprecated. Move to @xterm/addon-fit instead.
➤ YN0061: │ xterm-addon-attach@npm:0.9.0 is deprecated: This package is now deprecated. Move to @xterm/addon-attach instead.
➤ YN0061: │ @types/http-proxy-middleware@npm:1.0.0 is deprecated: This is a stub types definition. http-proxy-middleware provides its own type definitions, so you do not need this installed.
➤ YN0061: │ lodash.get@npm:4.4.2 is deprecated: This package is deprecated. Use the optional chaining (?.) operator instead.
➤ YN0032: │ isolated-vm@npm:5.0.3: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ domexception@npm:2.0.1 is deprecated: Use your platform's native DOMException instead
➤ YN0061: │ w3c-hr-time@npm:1.0.2 is deprecated: Use your platform's native performance.now() and performance.timeOrigin.
➤ YN0061: │ core-js@npm:2.6.12 is deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
➤ YN0035: │ @redhatinsights/backstage-plugin-acs@npm:^0.1.0: The remote server failed to provide the requested resource
➤ YN0035: │   Response Code: 404 (Not Found)
➤ YN0035: │   Request Method: GET
➤ YN0035: │   Request URL: https://registry.npmjs.org/@redhatinsights%2fbackstage-plugin-acs
➤ YN0000: └ Completed in 38s 582ms
➤ YN0000: Failed with errors in 38s 596ms
➤ YN0032: @swagger-api/apidom-parser-adapter-yaml-1-2@npm:1.0.0-beta.11: Implicit dependencies on node-gyp are discouraged
➤ YN0032: @swagger-api/apidom-parser-adapter-json@npm:1.0.0-beta.11: Implicit dependencies on node-gyp are discouraged
➤ YN0032: @tree-sitter-grammars/tree-sitter-yaml@npm:0.7.0: Implicit dependencies on node-gyp are discouraged
➤ YN0032: tree-sitter-json@npm:0.24.8: Implicit dependencies on node-gyp are discouraged
➤ YN0032: node-addon-api@npm:8.3.0: Implicit dependencies on node-gyp are discouraged
➤ YN0032: tree-sitter@npm:0.22.1: Implicit dependencies on node-gyp are discouraged
➤ YN0032: fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: xterm@npm:5.3.0 is deprecated: This package is now deprecated. Move to @xterm/xterm instead.
husky - pre-commit script failed (code 1)
#

But that's all.

#

I have created my workspace and here are the files within that:

#

Within my single plugin:```dev dist-dynamic package.json README.md src

shy needle
#

This jumps out at me, trying to get: @redhatinsights/backstage-plugin-acs@npm:^0.1.0 failed with a 404

#

Which then would cause the Yarn install to fail

deep blade
#

Hmm, okay. So currently we don't have it pushing to an npm registry. I thought that happened during the process of converting it to the community plugins repo. We basically use github releases for our management of the plugin.

#

I do see the full thing is: Request URL: https://registry.npmjs.org/@redhatinsights%2fbackstage-plugin-acs

shy needle
#

I guess I'm not sure why it would be requesting it anywhere but that's the thread I'd be pulling on. Maybe do a search for that text and remove it from the code.

deep blade
#

Yeahhh I see it trying in the packages/app directory

#

Just noticed.

#

When I'm migrating the files into the community plugin repo, do I also need to copy the packages directory?

#

I don't specifically see that in the instructions.

shy needle
#

No, ideally it's just the plugin. Keep the initial PR size small as that makes it faster to review and merge the first version

deep blade
#

Okay cool. I have a bunch of errors from eslint, is there any way to get around this?

shy needle
#

Yes, you need to fix them.

deep blade
#

Thank you.

shy needle
#

Sorry, I can help but there's no easy button. They need to be fixed to get the CI passing. These are conventions that we feel are the standard we want to see in the plugins contributed to this repo.

deep blade
#

I understand. I'll work on it now. Thank you for your help.