-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
fix:GH-1502 name root from package json #1503
fix:GH-1502 name root from package json #1503
Conversation
Signed-off-by: Ivan Alvarez Sabin <[email protected]>
d9ca0f7
to
88aeb33
Compare
ppurl = new PackageURL( | ||
"npm", | ||
options.projectGroup || tmpParentComponent.group, | ||
"project-name" in options ? options.projectName : tmpParentComponent.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows the use of the --project-name property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does options.projectName || tmpParentComponent.name
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, your solution doesn’t work. options.projectName is always set to the folder name.
The only way I can check if --project-name was provided is by verifying whether project-name is contained in the options.
When --project-name is not provided, project-name doesn’t appear as an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting observation! Will make a note of this. Thank you!
Signed-off-by: Ivan Alvarez Sabin <[email protected]>
These are the evidences of code modification: Before code modification package.json {
"name": "skippr",
"version": "1.2.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-sass": "^0.7.3",
"grunt-contrib-uglify": "^0.5.1",
"grunt-contrib-watch": "^0.6.1"
}
} bom.json "component": {
"group": "",
"name": "skippr-folder",
"version": "1.2.0",
"type": "application",
"purl": "pkg:npm/[email protected]",
"bom-ref": "pkg:npm/[email protected]"
} After code modification (without --project-name param) package.json {
"name": "skippr",
"version": "1.2.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-sass": "^0.7.3",
"grunt-contrib-uglify": "^0.5.1",
"grunt-contrib-watch": "^0.6.1"
}
} bom.json "component": {
"name": "skippr",
"group": "",
"version": "1.2.0",
"purl": "pkg:npm/[email protected]",
"bom-ref": "pkg:npm/[email protected]",
"type": "application"
} After code modification (with --project-name param) package.json {
"name": "skippr",
"version": "1.2.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-sass": "^0.7.3",
"grunt-contrib-uglify": "^0.5.1",
"grunt-contrib-watch": "^0.6.1"
}
} bom.json "component": {
"name": "custom-name-test",
"group": "",
"version": "1.2.0",
"purl": "pkg:npm/[email protected]",
"bom-ref": "pkg:npm/[email protected]",
"type": "application"
} |
I think we might need another fix to use the information from package.json if |
Yes, if I understand you correctly, I cover the case where --project-name is not provided. You can see this in the example.
Am I wrong? Can you give me more information about your concern? |
Looks good now. Must have seen a smaller diff. Can you look into this comment? https://github.com/CycloneDX/cdxgen/pull/1503/files#r1894034307 |
Yes, I have responded to your question. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Closes #1502