-
Notifications
You must be signed in to change notification settings - Fork 214
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: strip appsDir and libsDir from path if app|application or lib|library #1082
Conversation
Nx Cloud ReportCI ran the following commands for commit e534139. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
.replace(/\\/g, '/') | ||
.replace(/^\//, ''); | ||
|
||
const nxConfig = readAndCacheJsonFile('nx.json', workspacePath); |
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.
I tried this with workspaceLayout()
using a deep import from nx/workspace, but it wasn't giving me the configured path with a workspace I was testing on for some reason.
return { | ||
path, | ||
directory: path, | ||
project: projectName, | ||
projectName, |
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.
I also slipped in support for setting the projectName
schema option. Some of our generators use projectName
rather than project
.
…menu instead of path/directory and project; otherwise, if no project option, set pathdirectory
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.
Nice, things are working better now!
I can't seem to figure out how we could determine if a schematic/generator is a project and what the projectType is from the schema before it is generated, and I am not totally happy with this
schematic.name === 'application' || schematic.name === 'app'
andschematic.name === 'library' || schematic.name === 'lib'
solution.Update: added a commit that only sets project/projectName or path/directory from the explorer context menu, not both. Project takes precedence.