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

Fix issues with custom plugins #652

Merged
merged 2 commits into from
May 17, 2024
Merged

Fix issues with custom plugins #652

merged 2 commits into from
May 17, 2024

Conversation

ivomurrell
Copy link
Contributor

Description

This fixes some issues where custom plugins couldn't be loaded nor would their task options be passed to them. Tested with experimentation-api's WIP custom plugin for Node test runner.

Checklist:

  • My branch has been rebased onto the latest commit on main (don't merge main into your branch)
  • My commit messages are conventional commits, for example: feat(circleci): add support for nightly workflows, fix: set Heroku app name for staging apps too

Custom plugins can be imported using a relative path. We had previously
switched to resolve-pkg to be able to handle plugins without an
entrypoint, however this package can't handle resolving relative paths.
Additionally, resolve-from's functionality is now available in Node's
require API so let's remove both packages (this will also make it easier
to migrate to ESM in the future).

Now we can roll our own resolution logic that takes what we were using
from the resolve-pkg package (resolving a package.json instead of an
entrypoint) and adds adds support for relative paths too.
This allows custom plugins (who won't have a schema associated with
them) to still use task options.
@ivomurrell ivomurrell requested a review from a team as a code owner May 16, 2024 17:40
Copy link
Contributor

@meel-io meel-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfectly

@ivomurrell ivomurrell merged commit 593f51a into next May 17, 2024
14 checks passed
@ivomurrell ivomurrell deleted the fix-custom-plugins branch May 17, 2024 11:35
ivomurrell added a commit that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants