-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: relative name of exposed component #11
Conversation
--useFederatedAlias
Nice PR! But You should use Just like in my closed PR: const moduleDeclareName = path.join(federationConfig.name, exposeName).replace(/[\\/]/g, '/'); Also: Example:
Generates 3 declarations, not 2:
So your |
@crutch12 Nice catch! Thanks! |
--useFederatedAlias
@gthmb WDYT about this? :) |
Nice! I think it's right decision: |
Exactly, I think the same that exposed name should take precedence over module name 👍
We can keep compatibility but after this we should introduce new argument for using exposed name as module name |
@gthmb Do you still support this package? |
Hi! I lost access to this package when I changed jobs -_-. I have requested write access again to approve/merge PRs. Worst case , I can fork it and maintain a new fork, but I'd like to maintain this repo if possible. |
@gthmb Hey buddy! You should be good now ;-) |
This looks great! Thanks for sussing through the naming stuff here. I also agree that the exposed name should be the default behavior. I'll make a 0.2.0 release! |
I would like to propose new optional
--useFederatedAlias
argument which takes precedence over automatically generated module name in declaration file (*.d.ts):AS IS:
a) With
federation.config.json
like this:make-federated-types
produces the following declarations (shared
path is omitted):b) With
federation.config.json
like this:make-federated-types
produces the following declarations (shared
andtest
path are taken into module names):As you can see generated module name depends on source path (imho
ts.createProgram
somehow combines path) and you can not rely on this name during the imports on remote applications because you can have two possible import paths (and you don't know which one will be generated):TO BE:
make-federated-types --config ./path/to/my/config.json --useFederatedAlias
When you have
federation.config.json
like this:make-federated-types
produces the following declarations:When you have
federation.config.json
like this:make-federated-types
produces the following declarations: