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

Only include lib dependencies in package #4716

Closed
Rich-Harris opened this issue Apr 24, 2022 · 2 comments
Closed

Only include lib dependencies in package #4716

Rich-Harris opened this issue Apr 24, 2022 · 2 comments
Labels
feature request New feature or request pkg:svelte-package Issues related to svelte-package
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the problem

Moving #2884 (comment) into its own issue. If a repo contains both an app and a package, it's quite possible for package.json to contain dependencies that are only relevant to the app. These get copied into package/package.json on svelte-kit package.

Describe the proposed solution

It'd be nice if the generated package.json only included the dependencies that were referenced in lib.

Alternatives considered

Give users manual control over the package.json. Would make a good all-purpose escape hatch, but is very much a case of forcing the human to do the computer's job.

Importance

nice to have

Additional Information

No response

@Rich-Harris Rich-Harris added the feature request New feature or request label Apr 24, 2022
@Rich-Harris Rich-Harris added this to the 1.0 milestone Apr 24, 2022
@dummdidumm dummdidumm added the pkg:svelte-package Issues related to svelte-package label Apr 24, 2022
@paperdave
Copy link
Contributor

i've been looking into how an implementation would look, and it seems related logic was done in #2453 with replacing $lib imports. though that implementation uses some regular expressions, which many commented on how it wasn't ideal, but it was merged due to importance. I think the ideal solution would be a single pass that parses the js/svelte file to do the analysis of this issue and the modification of the alias resolving (finishing alias resolving could be related to #4734 which i was looking into as well).

for the short term i could go and quickly throw together some regex based solution, but since this isn't as important, it might be more valuable to implement it correctly, but i'm unsure what tools/method I should use for that.

if you have any ideas on how proper parsing of files would go, i'd love to take a stab at implementing this, and maybe even fix up the aliasing stuff (or should the latter be a separate PR after?)

@benmccann benmccann modified the milestones: 1.0, post-1.0 Jul 27, 2022
@dummdidumm
Copy link
Member

In the spirit of #8825 I think that we shouldn't do this and instead educate people what to put where.

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request pkg:svelte-package Issues related to svelte-package
Projects
None yet
Development

No branches or pull requests

4 participants