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

Convert macro.js to TypeScript #52

Open
JoshuaKGoldberg opened this issue Jul 17, 2023 · 0 comments
Open

Convert macro.js to TypeScript #52

JoshuaKGoldberg opened this issue Jul 17, 2023 · 0 comments
Labels
area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this!

Comments

@JoshuaKGoldberg
Copy link
Collaborator

JoshuaKGoldberg commented Jul 17, 2023

Following #50 -> #51: I didn't try to convert macro.js to TypeScript because I'm not very familiar with https://github.com/kentcdodds/babel-plugin-macros. But in theory it'd be nice for someone who is more familiar to:

  • Delete macro.d.ts
  • Rename macro.js to macro.ts
  • Adjust the build tooling so that macro.d.ts gets recreated, akin to today's build:types for dedent.js -> dist/dedent.d.ts
@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! area: tooling Managing the repository's maintenance labels Jul 17, 2023
JoshuaKGoldberg added a commit that referenced this issue Jul 17, 2023
Fixes #50.

Integrates with a few tools:

* TypeScript itself for type checking (`yarn tsc`)
* [Babel's TypeScript
preset](https://babeljs.io/docs/babel-preset-typescript) to stick with
the existing output process (`yarn build:legacy`, `yarn build:modern`)
* [tsup](https://tsup.egoist.dev) to generate a single `.d.ts` from
`dedent.ts` (`yarn build:types`)

Types are moved from `index.d.ts` to `dist/dedent.d.ts` to match the
other `dist/*` files. I confirmed with [the `attw`
cli](https://github.com/arethetypeswrong/arethetypeswrong.github.io/tree/e33adb4d894b041a51b8366bf0611ff5ecaf38cb/packages/cli)
that these support various Node resolution strategies.

`macro.js` and `macro.d.ts` are untouched, per #50 -> #52.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this!
Projects
None yet
Development

No branches or pull requests

1 participant