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(hooks): add utils in 'config:resolved' hook args #2129

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

astahmer
Copy link
Collaborator

@astahmer astahmer commented Feb 2, 2024

Closes #1902
Closes #1784

📝 Description

Add utils functions in the config:resolved hook, making it easy to apply transformations after all presets have been
merged.

For example, this could be used if you want to use most of a preset but want to completely omit a few things, while
keeping the rest. Let's say we want to remove the stack pattern from the built-in @pandacss/preset-base:

import { defineConfig } from '@pandacss/dev'

export default defineConfig({
  // ...
  hooks: {
    'config:resolved': ({ config, utils }) => {
      return utils.omit(config, ['patterns.stack'])
    },
  },
})

💣 Is this a breaking change (Yes/No):

no

📝 Additional Information

better alternative to #2105

Copy link

changeset-bot bot commented Feb 2, 2024

🦋 Changeset detected

Latest commit: 5d9cd7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@pandacss/config Patch
@pandacss/types Patch
@pandacss/dev Patch
@pandacss/fixture Patch
@pandacss/node Patch
@pandacss/parser Patch
@pandacss/studio Patch
@pandacss/core Patch
@pandacss/generator Patch
@pandacss/logger Patch
@pandacss/preset-atlaskit Patch
@pandacss/preset-base Patch
@pandacss/preset-open-props Patch
@pandacss/preset-panda Patch
@pandacss/token-dictionary Patch
@pandacss/astro-plugin-studio Patch
@pandacss/postcss Patch
@pandacss/extractor Patch
@pandacss/is-valid-prop Patch
@pandacss/shared Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
panda-docs ✅ Ready (Inspect) Visit Preview Feb 5, 2024 9:47am
panda-playground ✅ Ready (Inspect) Visit Preview Feb 5, 2024 9:47am
panda-studio ✅ Ready (Inspect) Visit Preview Feb 5, 2024 9:47am

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

2 participants