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

Make "extract" & "compile" publicly available API functions #1939

Closed
ervasive opened this issue Aug 9, 2020 · 9 comments
Closed

Make "extract" & "compile" publicly available API functions #1939

ervasive opened this issue Aug 9, 2020 · 9 comments

Comments

@ervasive
Copy link

ervasive commented Aug 9, 2020

Which package?
@formatjs/cli

Is your feature request related to a problem? Please describe.
I think it would be great to be able to run translations extraction and compilation programmatically through Node API in addition to CLI interface

@longlho
Copy link
Member

longlho commented Aug 9, 2020

I think the extraction API is there but not documented. I'll take a look!

@longlho
Copy link
Member

longlho commented Aug 9, 2020

Can you also provide your use case?

@ervasive
Copy link
Author

ervasive commented Aug 9, 2020

I think this can be generally helpful, but in my particular case, I'm working on a gatsby plugin for multilingual support with the idea for it to automatically handle message extraction and later compiling optimized translations resource(s) on production builds.

@ervasive
Copy link
Author

ervasive commented Aug 9, 2020

I think the extraction API is there but not documented. I'll take a look!

Yeah, it is. But as you said it is not documented, therefore it does not feel like the recommended way of using it.

Thank you

@longlho
Copy link
Member

longlho commented Aug 9, 2020

Yeah i do export them for testing so I'll document it

@ervasive
Copy link
Author

ervasive commented Aug 9, 2020

Yeah i do export them for testing so I'll document it

It seems like the "compile" function is tied to the CLI usecase and does not return the compiled output

@longlho longlho closed this as completed in ca4aa5a Aug 9, 2020
@longlho
Copy link
Member

longlho commented Aug 9, 2020

@formatjs/cli@2.5 should have this

@bertho-zero
Copy link
Contributor

@longlho can compileFolder also be exported?

@longlho
Copy link
Member

longlho commented Sep 25, 2020

yeah can you submit a different GH issue?

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

No branches or pull requests

3 participants