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

packageRules.matchJsonata #31820

Closed
rarkins opened this issue Oct 7, 2024 · 1 comment · Fixed by #31826
Closed

packageRules.matchJsonata #31820

rarkins opened this issue Oct 7, 2024 · 1 comment · Fixed by #31826
Labels
core:package-rules Relating to package-rules e.g. matchers priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Oct 7, 2024

Describe the proposed change(s).

Add new config option (to lib/config/options) matchJsonata with parent packageRules, to sit alongside matchPackageNames, matchCategories, etc.

  • Add new option matchJsonata to lib/config/options/index.ts of type string, with parent packageRules
  • Add a heading and detailed description for it in docs/usage/configuration-options
  • Create a new class extending Matcher for it, under lib/util/package-rules
  • If matchJsonata is configured, we should use JSONata (npm package jsonata) to query the string against the full config object passed to the Matcher, and return true or false.
@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others core:package-rules Relating to package-rules e.g. matchers labels Oct 7, 2024
rarkins added a commit that referenced this issue Oct 7, 2024
Fixes #31820

Add `matchJsonata` configuration option to `packageRules`.

* Add new option `matchJsonata` of type string with parent `packageRules` in `lib/config/options/index.ts`.
* Create `JsonataMatcher` class in `lib/util/package-rules/jsonata.ts` extending `Matcher` and implement `matches` method using JSONata.
* Import `JsonataMatcher` in `lib/util/package-rules/matchers.ts` and add it to the `matchers` array.
* Add tests for `JsonataMatcher` class in `lib/util/package-rules/jsonata.spec.ts`.
* Update types to include `matchJsonata` under `packageRules` in `lib/config/types.ts`.
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 38.114.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core:package-rules Relating to package-rules e.g. matchers priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
2 participants