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

Use tsx instead of ts-node #34

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Use tsx instead of ts-node #34

merged 1 commit into from
Jul 23, 2024

Conversation

james04321
Copy link
Collaborator

@james04321 james04321 commented Jul 23, 2024

Use tsx instead of ts-node, which is broken on Node >20.

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

@james04321 james04321 marked this pull request as ready for review July 23, 2024 14:41
@james04321 james04321 requested a review from a team July 23, 2024 15:24
@james04321 james04321 merged commit fd76bc0 into main Jul 23, 2024
1 check passed
@james04321 james04321 deleted the james-yang/use-tsx branch July 23, 2024 16:49
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.

2 participants