Better default for component name (`odo init`/`odo dev`)
/kind user-story
User Story
As an odo user working Java or NodeJS project I've already defined my project name in pom.xml or package.json file I want odo to suggest a default name that is based on the name that I already defined. So that I don't have to type it again.
This is about ? Enter component name: question in initial flow in odo init and odo dev
Acceptance Criteria
- [ ] if
package.jsonexists the suggested default component name should be value of thenamefield frompackage.json; - [ ] if
pom.xmlexists the suggested default component name should be value of theartifactIdfield frompom.xml - [ ] if non of the previous rules was applied use the name of the current directory as a default component name.
- [ ] in all cases the name needs to be sanitized to make sure that it is always valid based on the allowed format for devfile's
metadata.name
/priority medium
/kind user-story
The logic for detecting the project name should be implemented in Alizer. Alizer should be the main place where we put all the logic to detect information from the projects source code
/status blocked https://github.com/redhat-developer/alizer/issues/96
redhat-developer/alizer#96
Issue resolved.
For unsupported projects, alizer will return the directory name.