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

[BUG] --prod flag includes devDependencies of workspace packages in module's dependencies list #256

Open
1 of 2 tasks
Llois41 opened this issue Jan 29, 2025 · 7 comments
Open
1 of 2 tasks
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Llois41
Copy link

Llois41 commented Jan 29, 2025

Describe the bug

When having a workspace package, importing it as a dependency leads cyclonedx-yarn to include their devDependency in the SBOM as well.

To Reproduce

https://github.com/Llois41/cyclondx-dev-dependency-reproduction/tree/master

Expected behavior

I would expect that in the created sbom.json file there will also only be production dependencies of the workspace's package.

Environment

  • @cyclonedx/yarn-plugin-cyclonedx version: 2.0.0
  • yarn version: 4.5.3
  • Node version: 22.13.1
  • OS: MacOS

Contribution

  • I am willing to provide a fix
  • I will wait until somebody else fixes it
@Llois41 Llois41 added the bug Something isn't working label Jan 29, 2025
@jkowalleck
Copy link
Member

Thank you for the report.

And thank you for providing an environment where the situation may be reproduced.
I will try to craft a test env for this project, which will come in handy for regression-testing.

@jkowalleck

This comment has been minimized.

@Llois41
Copy link
Author

Llois41 commented Jan 29, 2025

Hi @jkowalleck

I fixed the settings in the reproduction git repo, you should (after fresh git pull) be able to run it locally yourself. May I ask you to delete your last comment, because of the internal company URL? :)

Thanks for having a look!

@jkowalleck
Copy link
Member

jkowalleck commented Jan 29, 2025

it is still there: https://github.com/Llois41/cyclondx-dev-dependency-reproduction/blob/300481488a32697a2b27e3f648ee792fd6686432/.yarnrc.yml#L1
maybe you could fixup/squasch the repo to be just one commit. but then github still would keep the old (orphan) commit(git-node) somewhere.

Also, i do not see a reason for obscurity.
The internal resource is not reachable, and if it was, then you'd have much bigger problems - regardless whether the resource had a resolvable DNS entry .

so i think there is no need to worry about anything.
PS: even the official DB repos publish this resource:

@jkowalleck
Copy link
Member

some brief research showed, that the workspace support was lacking features.
see #257

@Llois41
Copy link
Author

Llois41 commented Jan 29, 2025

yeah, I didn't clean up the history, but the new master should at least work :D And yeah, I also think, it is no issue.

@jkowalleck Alright, thanks for creating the collector issue. Can you give a rough estimation when you will have the capacity to work on the workspace support?

If others run into this issue as well: For now we workaround by installing only production dependencies and then use the "zero-install yarn dlx wrapper", but this makes versioning a little bit harder, since we have to add a separate renovate config rule instead of just having the dependency in our package.json ^^

@jkowalleck
Copy link
Member

Can you give a rough estimation when you will have the capacity to work on the workspace support?

I might have some time in the next 6 months. can not promise anything.

Anyway, this tool is a community effort. Everybody is invited to contribute :-D
If you or your organization need a certain feature, feel free to donate/champion it.

@jkowalleck jkowalleck added the help wanted Extra attention is needed label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants