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

[addon-dev] Allow TS files in publicEntrypoints / appReexports #1094

Closed
josemarluedke opened this issue Jan 31, 2022 · 6 comments · Fixed by #1106
Closed

[addon-dev] Allow TS files in publicEntrypoints / appReexports #1094

josemarluedke opened this issue Jan 31, 2022 · 6 comments · Fixed by #1106

Comments

@josemarluedke
Copy link
Collaborator

josemarluedke commented Jan 31, 2022

For addons authoring their code in TS (or soon gjs/gts), currently is not possible to use @embroider/addon-dev's publicEntrypoints or appReexports methods.

We cannot use them because the dist files will end up with the same extension as the input.

In glimmer-apollo, I ended up doing a simple replace of .ts with .js.

https://github.com/josemarluedke/glimmer-apollo/blob/main/packages/glimmer-apollo/rollup.config.js#L7-L23

@NullVoxPopuli
Copy link
Collaborator

It turns out this isn't needed - stay tuned!

@NullVoxPopuli
Copy link
Collaborator

I think the solution in #1099 is solid~ish, but I need to figure out a peerDep issue -- #1062
I think I'm getting two copies of xstate in the consuming app, and it's only revealing itself because of component-manager's reliance on object identity. 🤔

@rwjblue
Copy link
Collaborator

rwjblue commented Feb 3, 2022

@josemarluedke - Can you put up a separate (smaller) PR from #1099 that ensures that the output path is .js similar to what you did here (though with more robust extension replacement support probably)?

@josemarluedke
Copy link
Collaborator Author

@rwjblue Can definitely do it. Should extension replacement support the following mapping?

  • ts -> js
  • gts -> js
  • gjs -> js
  • hbs -> js

@rwjblue
Copy link
Collaborator

rwjblue commented Feb 3, 2022

yep! but I think we already have hbs -> js done right?

return {
code,
id: id + '.js',
};

@josemarluedke
Copy link
Collaborator Author

@rwjblue PR here: #1106

@ef4 ef4 closed this as completed in #1106 Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants