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

Multiple Entries - --entry exists but not documented well/broken #739

Closed
neilchaudhuri opened this issue Jun 3, 2020 · 3 comments · May be fixed by #367
Closed

Multiple Entries - --entry exists but not documented well/broken #739

neilchaudhuri opened this issue Jun 3, 2020 · 3 comments · May be fixed by #367
Labels
kind: support Asking for support with something or a specific use case scope: docs Documentation could be improved. Or changes that only affect docs solution: duplicate This issue or pull request already exists topic: multi-entry Related to multi-entry support

Comments

@neilchaudhuri
Copy link

neilchaudhuri commented Jun 3, 2020

I am building a React component library for the design system in our organization and have a bunch of components (and supporting objects like enums and interfaces) inside src. As they are not in index.tsx they aren't making it into the bundle although the type definitions are being created.

And when I do this: tsdx build --entry src/**/**.tsx

It just pulls the first file in the first directory under src.

I have noticed some issue threads here on multiple entry support, and it seems to be supported. But I don't see any documentation as to how. I would appreciate if you could point me to that or let me know if in fact such support doesn't exist. I just wanted to check here before bringing in something else like plugin-multi-entry.

@agilgur5
Copy link
Collaborator

agilgur5 commented Jun 4, 2020

Sorry about that, it is actually not supported. I believe that flag (I didn't add it) was added for multi-entry but was never quite working; this issue actually duplicates #175 . I added #367 as one of my first PRs to fix this actually, but it's been somewhat stalled, first on reviews (I eventually became a maintainer and am the only active one right now), and then on some manual steps it requires and some breaking changes involved.

It'll likely release with manual steps involved as, per the PR comments, I am not really sure of a non-intrusive way of automating it.

I've gotten a bit busy so I'm behind on releases, but as a result there's more time in-between where breaking changes can be shipped, so I'll likely end up shipping the bigger, completed, breaking issues faster and smaller changes in between to go with that cadence and not stall breaking things so much.

@agilgur5 agilgur5 closed this as completed Jun 4, 2020
@agilgur5 agilgur5 changed the title Quick Question on Multiple Entries Multiple Entries - --entry exists but not documented well/broken Jun 4, 2020
@agilgur5 agilgur5 added solution: duplicate This issue or pull request already exists topic: multi-entry Related to multi-entry support labels Jun 4, 2020
@neilchaudhuri
Copy link
Author

neilchaudhuri commented Jun 4, 2020

No worries. No one likes documentation, and it isn't always reliable. I was just confused by the switch itself and the description of supporting "Entry module(s)."

So given that, what are the best practices for where I have created tens of components like Button.tsx, Text.tsx, Link.tsx, etc. (and each with supporting primitives like enums and type declarations)? Do I copy the contents into index at build/publish time manually? Do I try to mess with @rollup/plugin-multi-entry (which I have FWIW)?

As I am sure this is a solved problem, I would love to know how the community approaches it.

@agilgur5
Copy link
Collaborator

agilgur5 commented Jun 4, 2020

No one likes documentation, and it isn't always reliable.

I wouldn't say "no one likes docs", I write a ton all the time, that PR even has some. But yes, they are unfortunately not always reliable.
Though in this case, it's actually that the feature was never quite fully worked out (I have also added LOTS of tests to the codebase so these things don't occur often), so now that's a bug rather than a docs issue.

As I am sure this is a solved problem, I would love to know how the community approaches it.

Wellllll it's actually not a solved problem because that PR stalled. You hit the nail on the head there unfortunately.
There's various internal changes there so I don't believe plugin-multi-entry alone would make it possible. In the meantime, you can use my fork in that PR (which is a bit dated/needs rebasing; there's directions in the comments), or follow a pattern similar to #713 (comment)

@agilgur5 agilgur5 added the kind: support Asking for support with something or a specific use case label Jun 4, 2020
@agilgur5 agilgur5 linked a pull request Jul 7, 2020 that will close this issue
7 tasks
@agilgur5 agilgur5 added the scope: docs Documentation could be improved. Or changes that only affect docs label Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: support Asking for support with something or a specific use case scope: docs Documentation could be improved. Or changes that only affect docs solution: duplicate This issue or pull request already exists topic: multi-entry Related to multi-entry support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants