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

Remove type bundling recommendation for CLIs #70

Open
2 tasks
Tobbe opened this issue Jun 24, 2024 · 5 comments
Open
2 tasks

Remove type bundling recommendation for CLIs #70

Tobbe opened this issue Jun 24, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Tobbe
Copy link

Tobbe commented Jun 24, 2024

Feature request

I'd like an option to totally ignore all devDependencies and to not recommend moving types to the dependencies array

Motivations

I might very well be misunderstanding how things works. If so, please correct me. But for my use case I think it'd make sense to have an option to totally ignore devDependencies. And also to not print the recommendation to bundle types (Recommendation: "@types/findup-sync" is externalized because "findup-sync" is in "dependencies". Place "@types/findup-sync" in "dependencies" as well so users don't have missing types.)

I'm using pkgroll to bundle up a TS project to be used by npx. So it's not supposed to be consumed by anyone, so there is no need for any type information. And my devDeps are things like "tsx" and "typescript". I don't see a reason to bundle stuff like that. (Maybe tree shaking already takes care of that concern)

Alternatives

One alternative is what I'm doing now: Just ignore the recommendations - and hope for the best when it comes to tree shaking taking care of not actually bundling my devDeps

Additional context

No response

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work financially will speed up resolution

  • I'm willing to offer financial support
@Tobbe Tobbe added the enhancement New feature or request label Jun 24, 2024
@privatenumber
Copy link
Owner

It only bundles in dev dependencies that are imported.

For example, tsx is also designed to be used with npx and has typescript as a dev dependency. But since it doesn't import it, it doesn't get bundled in.

You can vet the results with pkg-size: https://pkg-size.dev/tsx

@privatenumber
Copy link
Owner

There seems to be a confusion here so the issue itself is not valid, but I'm going to leave this open with the action item to be to improve the docs to clarify this.

@Tobbe
Copy link
Author

Tobbe commented Jun 25, 2024

the issue itself is not valid

Do you think the recommendation to include types is also still valid even for things like CLI tools and other packages that are not libraries?

@privatenumber
Copy link
Owner

Good point. We should turn that recommendation off if the package is only a CLI (only has the bin property).

@privatenumber privatenumber changed the title Option to not bundle devDependencies Remove type bundling recommendation for CLIs Jul 19, 2024
@yeliex
Copy link
Contributor

yeliex commented Aug 1, 2024

Good point. We should turn that recommendation off if the package is only a CLI (only has the bin property).

or just add a flag to disable it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants