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

Feature Request: Typescript token files support. #1391

Closed
hsjobeki opened this issue Nov 15, 2024 · 0 comments · Fixed by #1392
Closed

Feature Request: Typescript token files support. #1391

hsjobeki opened this issue Nov 15, 2024 · 0 comments · Fixed by #1392
Assignees

Comments

@hsjobeki
Copy link
Contributor

hsjobeki commented Nov 15, 2024

When using typescript with

deno
bun
or node with the --experimental-strip-types (nodejs/node#53725)

It is not required to transpile typescript into javascript anymore.

With style-dictionary it is possible to use javascript to generate style rules. such as I do.

I use typescript to proof that all my themes are consistent and for stability reasons.

source: ["build/*.*js"]

// src/dark.ts
import { light } from "../light/color.token.js";

// Let Typescript check that dark theme has the same values as light theme
type Dark = typeof light;

const dark: Dark = {...}

Unfortunately style dictionary cannot load my .ts files directly by using:

`source: ["src/*.*ts"]`

This would be much more convenient especially since all major runtimes do now support running typescript natively and i can run all my stuff without the intermediate step of transpiling everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants