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(core): support generator in rule matcher #3884

Merged
merged 1 commit into from
Jun 11, 2024
Merged

feat(core): support generator in rule matcher #3884

merged 1 commit into from
Jun 11, 2024

Conversation

antfu
Copy link
Member

@antfu antfu commented Jun 11, 2024

This PR adds the capability of using generator in rule matcher, for example:

defineConfig({
  rules: [
    [/^rule$/, function* () {
      yield {
        color: 'red',
      }
      yield {
        'font-size': '12px',
      }
    }],
  ],
})

Will result in

.rule{color:red;}
.rule{font-size:12px;}

Copy link

netlify bot commented Jun 11, 2024

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit 3fab49b
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/66687f152c26a1000878eff9
😎 Deploy Preview https://deploy-preview-3884--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu merged commit 7e15633 into main Jun 11, 2024
9 checks passed
@antfu antfu deleted the feat/gener branch June 11, 2024 16:53
Simon-He95 pushed a commit to Simon-He95/unocss that referenced this pull request Jun 12, 2024
Simon-He95 pushed a commit to Simon-He95/unocss that referenced this pull request Jun 12, 2024
ramackersjp added a commit to ramackersjp/Piped that referenced this pull request Jun 16, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@unocss/eslint-config](https://togithub.com/unocss/unocss/tree/main/packages/eslint-config#readme)
([source](https://togithub.com/unocss/unocss/tree/HEAD/packages/eslint-config))
| [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2feslint-config/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2feslint-config/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2feslint-config/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2feslint-config/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2feslint-config/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@unocss/preset-icons](https://togithub.com/unocss/unocss/tree/main/packages/preset-icons#readme)
([source](https://togithub.com/unocss/unocss/tree/HEAD/packages/preset-icons))
| [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2fpreset-icons/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2fpreset-icons/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2fpreset-icons/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2fpreset-icons/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2fpreset-icons/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@unocss/preset-uno](https://togithub.com/unocss/unocss/tree/main/packages/preset-uno#readme)
([source](https://togithub.com/unocss/unocss/tree/HEAD/packages/preset-uno))
| [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2fpreset-uno/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2fpreset-uno/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2fpreset-uno/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2fpreset-uno/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2fpreset-uno/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@unocss/preset-web-fonts](https://togithub.com/unocss/unocss/tree/main/packages/preset-web-fonts#readme)
([source](https://togithub.com/unocss/unocss/tree/HEAD/packages/preset-web-fonts))
| [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2fpreset-web-fonts/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2fpreset-web-fonts/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2fpreset-web-fonts/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2fpreset-web-fonts/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2fpreset-web-fonts/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [@unocss/reset](https://togithub.com/unocss/unocss) | [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2freset/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2freset/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2freset/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2freset/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2freset/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@unocss/transformer-directives](https://togithub.com/unocss/unocss/tree/main/packages/transformer-directives#readme)
([source](https://togithub.com/unocss/unocss/tree/HEAD/packages/transformer-directives))
| [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2ftransformer-directives/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2ftransformer-directives/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2ftransformer-directives/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2ftransformer-directives/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2ftransformer-directives/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@unocss/transformer-variant-group](https://togithub.com/unocss/unocss/tree/main/packages/transformer-variant-group#readme)
([source](https://togithub.com/unocss/unocss/tree/HEAD/packages/transformer-variant-group))
| [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/@unocss%2ftransformer-variant-group/0.60.4/0.61.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@unocss%2ftransformer-variant-group/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@unocss%2ftransformer-variant-group/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@unocss%2ftransformer-variant-group/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@unocss%2ftransformer-variant-group/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [unocss](https://togithub.com/unocss/unocss) | [`0.60.4` ->
`0.61.0`](https://renovatebot.com/diffs/npm/unocss/0.60.4/0.61.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/unocss/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/unocss/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/unocss/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/unocss/0.60.4/0.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>unocss/unocss (@&#8203;unocss/eslint-config)</summary>

### [`v0.61.0`](https://togithub.com/unocss/unocss/releases/tag/v0.61.0)

[Compare
Source](https://togithub.com/unocss/unocss/compare/v0.60.4...v0.61.0)

#####    🚀 Features

-   **core**:
- Support generator in rule matcher  -  by
[@&#8203;antfu](https://togithub.com/antfu) in
[unocss/unocss#3884
[<samp>(7e156)</samp>](https://togithub.com/unocss/unocss/commit/7e15633b)
- Introduce special symbols for applying custom variants  -  by
[@&#8203;antfu](https://togithub.com/antfu) in
[unocss/unocss#3885
[<samp>(d80f6)</samp>](https://togithub.com/unocss/unocss/commit/d80f6cad)
-   **preset-mini**:
- Add support for peer and group variants on aria-\* variants to
Preset-Mini  -  by [@&#8203;Johnkat-Mj](https://togithub.com/Johnkat-Mj)
and [@&#8203;Simon-He95](https://togithub.com/Simon-He95) in
[unocss/unocss#3692
[<samp>(c3265)</samp>](https://togithub.com/unocss/unocss/commit/c3265cc2)
-   **vscode**:
- Add borderRadius to control color cube  -  by
[@&#8203;Simon-He95](https://togithub.com/Simon-He95) and
[@&#8203;antfu](https://togithub.com/antfu) in
[unocss/unocss#3872
[<samp>(ad294)</samp>](https://togithub.com/unocss/unocss/commit/ad294ffd)

#####    🐞 Bug Fixes

-   **extractor-arbitrary-variants**:
- Quote in \[]  -  by
[@&#8203;Simon-He95](https://togithub.com/Simon-He95) and
[@&#8203;antfu](https://togithub.com/antfu) in
[unocss/unocss#3875
[<samp>(cd529)</samp>](https://togithub.com/unocss/unocss/commit/cd5296f5)
-   **preset-mini**:
- ColorableShadows with cssvar  -  by
[@&#8203;Simon-He95](https://togithub.com/Simon-He95) in
[unocss/unocss#3878
[<samp>(1ac22)</samp>](https://togithub.com/unocss/unocss/commit/1ac223a4)
- Support composite props  -  by
[@&#8203;zyyv](https://togithub.com/zyyv) and
[@&#8203;antfu](https://togithub.com/antfu) in
[unocss/unocss#3810
[<samp>(f7ad5)</samp>](https://togithub.com/unocss/unocss/commit/f7ad5200)
- `transform-cpu` should not include `rotate-x` and `rotate-y`  -  by
[@&#8203;zzc6332](https://togithub.com/zzc6332) in
[unocss/unocss#3813
[<samp>(ae072)</samp>](https://togithub.com/unocss/unocss/commit/ae072a54)
-   **transformer-attributify-jsx**:
- With prefix  -  by
[@&#8203;Simon-He95](https://togithub.com/Simon-He95) in
[unocss/unocss#3867
[<samp>(83728)</samp>](https://togithub.com/unocss/unocss/commit/83728748)
-   **vite**:
- Legacy chunks build  -  by
[@&#8203;Simon-He95](https://togithub.com/Simon-He95) and
[@&#8203;antfu](https://togithub.com/antfu) in
[unocss/unocss#3879
[<samp>(c7f63)</samp>](https://togithub.com/unocss/unocss/commit/c7f63118)

#####     [View changes on
GitHub](https://togithub.com/unocss/unocss/compare/v0.60.4...v0.61.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ramackersjp/Piped).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
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.

None yet

1 participant