-
Notifications
You must be signed in to change notification settings - Fork 394
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
cli compile api: Allow to specify namespace/module type for createCompiledCatalog #285
Comments
Hey @dephiros,
If you could also add this as a option to |
Hi @tricoder42 , My next step is to:
I also notice that in local env, there are 11 tests fails in |
Hey @dephiros, PR looks great! What tests are failing? Everything on CI runs fine, even for me locally. What OS and node version do you have? Btw I usually manually test CLI by running source files using cd packages/cli/test/fixtures/extract/
babel-node ../../../src/lingui-extract.js It's dirty, but fast... |
@tricoder42 , I can't seem to run babel-node like you mentioned. It kept giving me Here is the failed tests:
|
@tricoder42, I ended up using At this point, I think I added all the pieces(test, doc). However, I am running to this error where jest generates extra |
@tricoder42, another update on the progress:
Please let me know if you have any additional feedbacks. |
@dephiros This is a really solid work! Thank you very much. I went through PR and changed few things:
I'm just waiting for tests to be sure I haven't broke anything. Once it's done, I'll merge. Thank you very much again! |
Awesome! Thank you for your help as well |
Released in v2.6.0 |
Is your feature request related to a problem? Please describe.
I am planning to use jsLingui for a project at work. For various reasons and legacy codebase support, I cannot use jsLingui extraction mechanism and module import and need to inject json/objects as the catalogs for jsLingui in
global
From @tricoder42 's response and after looking at the code a bit more, jsLingui core production module does not ship with the compiler and cannot use raw catalog.
Rather than using the raw catalog though, it would be very nice if I can use a compiled js object as the catalog to non-module JS code.
Currently the output for
createCompiledCatalog
is:What I would like to be able to do with
createCompiledCatalog
is:Describe the solution you'd like
Similar to
--namespace
argument for messageformat.js CLI, we can add a namespace param tocreateCompiledCatalog
(not surenamespace
is the right name here; suggestions are welcomed):export default {}
I can put together a pull request sometimes this weekend or next week.
The text was updated successfully, but these errors were encountered: