Skip to content

feat(theme types): generate theme types and bundle into dist for consumption#995

Draft
ByronDWall wants to merge 6 commits intomainfrom
bw/ts-chakra-theme-module-augmentation
Draft

feat(theme types): generate theme types and bundle into dist for consumption#995
ByronDWall wants to merge 6 commits intomainfrom
bw/ts-chakra-theme-module-augmentation

Conversation

@ByronDWall
Copy link
Contributor

This pull request introduces automated generation and inclusion of Chakra UI type augmentations for the Nimbus theme, ensuring that consumers of the package get full TypeScript support for custom recipes, tokens, and conditions without needing to run typegen themselves. The changes streamline the process by adding a new script, updating build commands, and ensuring the generated types are shipped with the package.

Type augmentation automation and integration:

  • Added a new script scripts/generate-chakra-types.ts that runs Chakra's typegen, transforms the output into module augmentation declarations, and writes them to src/theme/chakra-types.gen.d.ts. This script ensures that Nimbus's custom theme types are automatically generated and bundled.
  • Updated the build-theme-typings command in package.json to use the new script via tsx, replacing the previous Chakra CLI invocation.
  • Included the generated type augmentations in the build output by enabling copyDtsFiles: true in the Vite config, ensuring consumers receive the typings in the published package.

Type support for consumers:

  • Added a triple-slash reference to chakra-types.gen.d.ts in src/theme/index.ts so that the augmentations are available to TypeScript consumers of the Nimbus theme.

Tooling improvements:

  • Added tsx as a dev dependency in package.json to support running TypeScript scripts directly.

@ByronDWall ByronDWall self-assigned this Jan 30, 2026
@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nimbus-documentation Ready Ready Preview Jan 30, 2026 5:41pm
nimbus-storybook Ready Ready Preview, Comment Jan 30, 2026 5:41pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

⚠️ No Changeset found

Latest commit: 77bd768

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@jaikamat jaikamat force-pushed the bw/ts-chakra-theme-module-augmentation branch from ce27268 to c632da6 Compare January 30, 2026 16:43
Copy link
Contributor

@jaikamat jaikamat left a comment

Choose a reason for hiding this comment

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

Thank you for the help! Super clean

@jaikamat jaikamat force-pushed the bw/ts-chakra-theme-module-augmentation branch from 683a0c8 to 884a298 Compare January 30, 2026 17:27
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.

4 participants