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(plugins): add support wildcard config for scoped package plugin #3659

Merged

Conversation

hdmr14
Copy link
Contributor

@hdmr14 hdmr14 commented Feb 26, 2021

If you wish load all scoped package plugins by @*/karma-* like karma-*, karma doesn't handle it.
It'll be modified to RegExp("^@.*/karma-*") internally, and karma doesn't care scoped package's sub directories.

In this PR, add features below.

  • support plugin name with multiple * (replace ALL * to .*)
    • @*/karma-* is now valid
    • karma-* also work same as before
    • however, if anyone already force using multiple * (such as karma-*-foo-.*), there is a risk of incompatibility
  • when finding plugin, get scoped package name now correctly (before: @foo, now: @foo/bar)

Fixes #3656

@google-cla
Copy link

google-cla bot commented Feb 26, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@karmarunnerbot
Copy link
Member

Build karma 539 completed (commit 632ce319f5 by @hdmr14)

@AppVeyorBot
Copy link

Build karma 2936 completed (commit 632ce319f5 by @hdmr14)

@karmarunnerbot
Copy link
Member

Build karma 538 completed (commit 632ce319f5 by @hdmr14)

@hdmr14
Copy link
Contributor Author

hdmr14 commented Feb 26, 2021

@googlebot I signed it!

Copy link
Collaborator

@devoto13 devoto13 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @hdmr14!

It turned out that we didn't have any tests for this functionality, so I've implemented some in devoto13@ee942c5 (going to submit those as a separate PR once yours is merged).

What I found out is that flatMap function is not available in Node 10, which Karma still supports. Can you please update your implementation to make sure that it supports Node 10 as well?

Besides this LGTM

@AppVeyorBot
Copy link

Build karma 2941 completed (commit 7e8c7cd539 by @hdmr14)

@karmarunnerbot
Copy link
Member

Build karma 544 completed (commit 7e8c7cd539 by @hdmr14)

@karmarunnerbot
Copy link
Member

Build karma 543 completed (commit 7e8c7cd539 by @hdmr14)

@hdmr14
Copy link
Contributor Author

hdmr14 commented Mar 5, 2021

@devoto13 Thanks for review and implement the tests!

PR now supports Node 10(replaced flatMap to map and reduce).

Copy link
Collaborator

@devoto13 devoto13 left a comment

Choose a reason for hiding this comment

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

LGTM

Tests will be added in the follow-up PR: #3661

@hdmr14
Copy link
Contributor Author

hdmr14 commented Mar 5, 2021

@googlebot I signed it!

@johnjbarton johnjbarton merged commit 39831b1 into karma-runner:master Mar 10, 2021
karmarunnerbot pushed a commit that referenced this pull request Mar 10, 2021
# [6.2.0](v6.1.2...v6.2.0) (2021-03-10)

### Features

* **plugins:** add support wildcard config for scoped package plugin ([#3659](#3659)) ([39831b1](39831b1))
@karmarunnerbot
Copy link
Member

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

This was referenced Mar 15, 2021
anthony-redFox pushed a commit to anthony-redFox/karma that referenced this pull request May 16, 2023
…arma-runner#3659)

* feat(plugins): add support wildcard config for scoped package plugin

* fix(plugins): support Node 10
anthony-redFox pushed a commit to anthony-redFox/karma that referenced this pull request May 16, 2023
# [6.2.0](karma-runner/karma@v6.1.2...v6.2.0) (2021-03-10)

### Features

* **plugins:** add support wildcard config for scoped package plugin ([karma-runner#3659](karma-runner#3659)) ([39831b1](karma-runner@39831b1))
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.

Load scoped package plugins by default
5 participants