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: Provide actual values in typescript definition files #36

Merged

Conversation

jaalah-akamai
Copy link
Collaborator

@jaalah-akamai jaalah-akamai commented Apr 12, 2024

Description 📝

In order to provide better type definitions to developers, we want to provide them with the actual values of the tokens, not just what primitive it is.

Major Changes 🔄

  • Upgraded sd-transforms and style-dictionary:
    • "@tokens-studio/sd-transforms": "^0.15.2"
    • "style-dictionary": "4.0.0-prerelease.25"
  • Using moduleResolution: "Bundler" - to allow package entrypoints to work and for those imports to be resolved
  • Changed format typescript/es6-declarations to javascript/es6 fixed this for non-nested tokens
  • For nested file, returning a string literal instead of the typeof. I was able to clean up formatProperties significantly.
  • We're now using shorthand for typography tokens

Preview 📷

Before After
Screenshot 2024-04-12 at 4 59 26 PM Screenshot 2024-04-12 at 4 59 56 PM
Screenshot 2024-04-12 at 4 59 12 PM Screenshot 2024-04-12 at 4 56 41 PM

Test

  • Checkout branch

  • Run yarn generate

  • Ensure nothing is broken and build completes

  • Run yarn storybook

  • Ensure everything renders appropriately there (not all components are listed there yet)

@jaalah-akamai jaalah-akamai added the enhancement New feature or request label Apr 12, 2024
@jaalah-akamai jaalah-akamai self-assigned this Apr 12, 2024
@jaalah-akamai jaalah-akamai merged commit f2a9761 into linode:main Apr 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants