-
-
Notifications
You must be signed in to change notification settings - Fork 9
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]: package normalization might cause crashes #745
Comments
Thanks for reporting. From the call stack you posted, it appears that not this webpack plugin is causing the error, but normalize-package-data. @sresch4b, Could you check with the developers of |
some background:
|
@jkowalleck |
That is not a valid package name and npm cannot support it because it is not anything that an npm registry will recognize. It is valid as a |
i might implement a fallback for this |
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
@sresch4b, could you see if the following meets your expectations? |
@jkowalleck Thx for your support, we really appreciate it! |
@jkowalleck I tested the version with two internal projects and the build ran through without breaking.
I will discuss the generated bom files with colleagues tomorrow, just in case they notice something else. |
I've asked another colleague to check the generated bom file for his project and it seems to be ok, with one exception that "luxon" is missing. |
luxon is missing, because you are not using it. this answer was based on https://github.com/sresch4b/cyclonedx-issue/tree/a7060b1180e738ffe20b70da0100a14b231aa059 |
Signed-off-by: Jan Kowalleck <[email protected]> Co-authored-by: jkowalleck <[email protected]>
some remarks - as this issue was resolved, now. re: #745 (comment)
answered here: #745 (comment)
No, they should be in the SBOM.
Webpack's logging rules are completely followed. |
Thx for the remarks and the explaination. Regarding to my example https://github.com/sresch4b/cyclonedx-issue I have the following code, where I'm importing and using DateTime from luxon:
If I search for "luxon" in the generated "dist/main.js" I also have some findings. The class name "DateTime" has been renamed for minification, but I can still find the code from above in the generated file. Therefore, I would argue that luxon is part of the generated code and should also be part of the BOM. However, you are welcome to correct me again. ;) Thank you for your efforts and support. |
Thanks for getting back, @sresch4b . |
@sresch4b you can always set webpack's you might find something like
|
@jkowalleck I run into the same issue with the latest version, because in your plugin.js you have another call to normalizePackageJson in "makeRootComponent". cyclonedx-webpack-plugin/src/plugin.ts Lines 298 to 309 in 58a4381
Stack trace like
|
is normalizePackageJson(thisPackageJson, w => { logger.debug('normalizePackageJson from PkgPath', path, 'caused:', w); }); inside of function _CycloneDxWebpackPlugin_makeRootComponent(path, builder, logger) {} so assumption is about right. The issue is thrown only when data you have under your control appears to be unexpected. You could just change your What do you think, @rkg-mm |
@jkowalleck after discussing with the responsible team I can, but the actual restriction is unnecessary here, or? since in this case its the name of a hybrid mobile app and not a package name in terms of something that is published on a package manager, so why restrict it and force changes on a project just to be able to generate a BOM file? |
The discussed normalization does not only affect the name.
Standards, for documentation’s sake. If you do not agree, just
|
related to #1284 |
Hi,
we're trying to setup your plugin, but are running into issues with some dependencies like "@apollo/client". This might not the only one, but is the first which seems to break with a package naming pattern.
Apollo seems to deliver a package.json for each of their sub-modules, where they extend the name with the module name (directory). Whether this is correct or not, I cannot judge, but acknowledging the problem with an error seems to me to be the wrong solution.
Perhaps there must be a way to configure this or it is valid to ignore them, cause it is (only) a sub-module of a package.
You can find a small example in the following repo:
https://github.com/sresch4b/cyclonedx-issue
I am curious about your perspective on this topic.
The text was updated successfully, but these errors were encountered: