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

CHORE: omit installation of unused, transitive optional dependencies #218

Closed
jkowalleck opened this issue Nov 14, 2024 · 4 comments
Closed

Comments

@jkowalleck
Copy link
Member

jkowalleck commented Nov 14, 2024

some transitive dependnecies are optional, the underlying features are not used; this project's tree shaking mechanismswere optimized to not include traces of them in the final build result.
this means: it is safe to ignore them on installation.

this is especially needed, in cases where the install fails. see #193 (comment) ff

see also: https://github.com/CycloneDX/cyclonedx-javascript-library?tab=readme-ov-file#optional-dependencies

goal: do not install the following transitive optional dependencies:

  • libxmljs2
  • ajv, ajv-formats, ajv-formats-draft2019
@jkowalleck
Copy link
Member Author

@AugustusKling ,

I will work on this. I remember there was a thing for that in yarn package manifest, something to override and modify transitive dependencies.

@AugustusKling
Copy link
Contributor

In case you are thinking about https://yarnpkg.com/configuration/yarnrc#packageExtensions, this won't help you as it can only add missing dependencies but not remove existing ones. There's also https://yarnpkg.com/configuration/manifest#resolutions which to my knowledge also does not support removal.

@jkowalleck
Copy link
Member Author

jkowalleck commented Nov 14, 2024

i am not planning on removing them, but overriding their "version" (resolution) to target a local package that is installable, and simply throws an error as soon as it is loaded. 😁
This way, we also have a proper smoke-test whether these optional deps are loaded/used unintentionally.

@jkowalleck jkowalleck changed the title CHORE: skip installation of unused, transitive optional dependencies CHORE: omit installation of unused, transitive optional dependencies Nov 14, 2024
@jkowalleck
Copy link
Member Author

#219 (comment)

tests show that the optional deps are not needed on compile time, but are required for some validation during tests.

@jkowalleck jkowalleck closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants