Skip to content
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

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

sandikbarr
Copy link
Contributor

@sandikbarr sandikbarr commented Jun 11, 2021

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' and schematic.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.

@nx-cloud
Copy link

nx-cloud bot commented Jun 11, 2021

Nx Cloud Report

CI 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

Status Command
#000000 nx run-many --all --parallel --target=build
#000000 nx run-many --all --parallel --target=lint
#000000 nx run-many --all --parallel --target=test

Sent with 💌 from NxCloud.

.replace(/\\/g, '/')
.replace(/^\//, '');

const nxConfig = readAndCacheJsonFile('nx.json', workspacePath);
Copy link
Contributor Author

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,
Copy link
Contributor Author

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
Copy link
Member

@Cammisuli Cammisuli left a 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!

@Cammisuli Cammisuli merged commit 7db8b08 into nrwl:master Jun 14, 2021
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