Skip to content

Commit

Permalink
Use tsx instead of ts-node (#34)
Browse files Browse the repository at this point in the history
Use tsx instead of ts-node, which is [broken on Node >20](TypeStrong/ts-node#2100).

Before:

```
$ npm run sync-figma-to-tokens

> sync-figma-to-tokens
> ts-node-esm -P tsconfig.json src/sync_figma_to_tokens.ts

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/jyang/figma/variables-github-action-example/src/sync_figma_to_tokens.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:143:22)
    at async nextLoad (node:internal/modules/esm/hooks:866:22)
    at async nextLoad (node:internal/modules/esm/hooks:866:22)
    at async Hooks.load (node:internal/modules/esm/hooks:449:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
```

After:

```
$ npm run sync-figma-to-tokens

> sync-figma-to-tokens
> tsx src/sync_figma_to_tokens.ts

Wrote Primitives — Completed.Modern Theme.json
Wrote Primitives — Completed.Brutal Theme.json
Wrote Tokens — Completed.Light.json
Wrote Tokens — Completed.Dark.json
Wrote Product interactions — Completed.Default.json
✅ Tokens files have been written to the tokens_new directory
```
  • Loading branch information
james04321 authored Jul 23, 2024
1 parent 92d4e33 commit fd76bc0
Show file tree
Hide file tree
Showing 2 changed files with 480 additions and 18 deletions.
Loading

0 comments on commit fd76bc0

Please sign in to comment.