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: [M3-7995] - Improve typescript definitions and how we export tokens - pt. 2 #38

Merged
merged 19 commits into from
Apr 26, 2024

Conversation

jaalah-akamai
Copy link
Collaborator

@jaalah-akamai jaalah-akamai commented Apr 17, 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 🔄

  • Using latest version of yarn and ESM: https://github.com/amzn/style-dictionary/releases/tag/v4.0.0-prerelease.0
  • Renamed config/ to style-dictionary/
  • Simplified the build step and reduced most of the files in /config that we were using to manually generate index files.
  • Improved the flexibility developers have when importing tokens
  • Moved utils, formats, transforms and configs to their own files

Examples:

You may import each tier of tokens: Global, Alias, Component

import { Global, Alias, Component } from '@linode/design-language-system';

You may alternately access any token set under each tier:

import { Color, Interaction, Button } from '@linode/design-language-system';

You selectively import tokens by extending the path:

import { Button } from '@linode/design-language-system/components';

All of the above applies to themes:

import { Global, Alias, Component } from '@linode/design-language-system/themes/dark';

Preview 📷

Before After
Screenshot 2024-04-17 at 1 58 34 PM Screenshot 2024-04-17 at 1 45 12 PM

Test

  • yarn generate
  • Ensure everything builds properly
  • Copy dist over to your local projects node_modules or yarn link projects together.
  • Copy package.json over to local projects node_modules

@jaalah-akamai jaalah-akamai added the enhancement New feature or request label Apr 17, 2024
@jaalah-akamai jaalah-akamai self-assigned this Apr 17, 2024
@jaalah-akamai jaalah-akamai marked this pull request as ready for review April 19, 2024 02:57
Copy link
Collaborator

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

This is amazing work! waiting for you to be back and other PRs to be merged to bump the version

@abailly-akamai abailly-akamai merged commit 5d8eaad into linode:main Apr 26, 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.

4 participants