-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support *FbtEnum.ts files #3
Conversation
3bfa36d
to
2f9fbb6
Compare
Did you try I do not mind that it's experimental, since it won't be experimental for too long. Otherwise, I would much prefer to use Babel to strip TypeScript syntax instead of typescript because the typescript package is large and we are already using it in other places like for common strings: https://github.com/nkzw-tech/fbtee/blob/main/packages/babel-plugin-fbtee/src/bin/FbtCollector.tsx#L65-L88 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
2f9fbb6
to
3e48ca3
Compare
No, but AFAICT we cannot enable a node.js flag without manually spawning a new process (or require consumers to pass a flag). But maybe I'm missing something? Makes sense to use Babel instead of TS though. Updated the PR! |
3e48ca3
to
a4f67b6
Compare
We should totally be in control of how the I assume you have to make the changes to the src file, |
a4f67b6
to
80b80b2
Compare
TIL! From what I can tell it works great. There is a warning logged when running the command that it's experimental but no big deal! |
Just add --no-warnings. Since it's fbtee's cli, that's fine. |
Use babel for transpilation
80b80b2
to
42f7236
Compare
Done! 👍 |
So elegant. Thank you! |
Stacked on #2 (needed the automatic external detection)
Currently you cannot have
.ts
files as enums and you get this errorI'm not sure the approach I've taken here is optimal, we could potentially use
ts-node
oresbuild-register
but didn't have much luck with using them in an ESM environment.Now every enum file is transpiled using TS regardless of the extension, it might be wiser to only transpile
.tsx?
files. I can update to do that if you think it's a good idea