Nx: @nrwl/angular app schematic shouldn't blindly pick workspace name as a prefix by default.

Created on 11 Oct 2020  路  2Comments  路  Source: nrwl/nx

Current Behavior

Given you have an empty workspace named like "mycompany.com"
Next you are generating angular app nx g @nrwl/angular:app myapp
if you'll omit setting prefix from command line, it will use workspace name as a prefix
which will lead to generated angular component selector "mycompany.com-root" which is an invalid HTML tag
since it has a DOT in it.

Expected Behavior



Escape it or filter somehow, do not blindly use the workspace name for the prefix.
You are allowing to create workspace name having dots in it, and then you are allowing me to shoot in my leg.

Steps to Reproduce


Given you have an empty workspace named like "mycompany.com"
Next you are generating angular app nx g @nrwl/angular:app myapp
if you'll omit setting prefix from command line, it will use workspace name as a prefix
which will lead to generated angular component selector "mycompany.com-root" which is an invalid HTML tag
since it has a DOT in it.




core bug

All 2 comments

Interesting find. That should not be a valid workspace name.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaelWarneke picture MichaelWarneke  路  3Comments

markphip picture markphip  路  3Comments

elliotmendiola picture elliotmendiola  路  3Comments

Svancara picture Svancara  路  3Comments

about-code picture about-code  路  3Comments