Skip to content

Allow npm projects without name and versions#546

Merged
yahavi merged 2 commits intojfrog:masterfrom
yahavi:npm-nameless
Aug 15, 2021
Merged

Allow npm projects without name and versions#546
yahavi merged 2 commits intojfrog:masterfrom
yahavi:npm-nameless

Conversation

@yahavi
Copy link
Copy Markdown
Member

@yahavi yahavi commented Aug 9, 2021

  • All tests passed. If this feature is not already covered by the tests, I added new tests.

package.json files are allowed to be without name and version nodes. Currently, the code throws NPE in such cases.
If name is missing, use the directory name as the project name.
If only version is missing, use the name without the version as the project name.
Otherwise, use : as the project name.

@yahavi yahavi requested review from eyalbe4 and talarian1 August 9, 2021 16:43
@yahavi yahavi self-assigned this Aug 9, 2021
* @param workingDir - The package.json directory
* @return <name>:<version>, <name> or <directory-name>
*/
static String getProjectName(JsonNode npmList, Path workingDir) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static String --> private static String

Copy link
Copy Markdown
Member Author

@yahavi yahavi Aug 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this function is in use in the test

@yahavi yahavi merged commit 736b505 into jfrog:master Aug 15, 2021
@yahavi yahavi deleted the npm-nameless branch August 15, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants