Home:ALL Converter>nrwl nx React tutorial confusing

nrwl nx React tutorial confusing

Ask Time:2019-09-05T00:21:44         Author:David Martin

Json Formatter

Following the Getting Started docs for nrwl react and the tutorial. The docs have you run specific commands and then show the folder structure that should be created. I am not seeing the same folder structure. (and some additional issues).

running nx g @nrwl/react:lib --project=ui should result in the following structure according to image shown:

workspace/libs/ui/src/lib/ui/(ui.css, ui.spec.tsx, ui.tsx)

instead I am getting:

workspace/libs/ui/src/lib/(files, etc.)

no second UI folder. Additionally, the docs show how to add components with nx g @nrwl/react:component todos --project=ui. When done I should have the following structure:

workspace/libs/ui/src/lib/todos/(todo files)

again, instead I get a structure:

workspace/libs/ui/src/lib/(todo files)

no todos folder. It is simply placing all component files into a single directory workspace/libs/ui/src/lib/

I am aware that the generate command can take a --directory parameter and this results in what is expected. So I'm mainly wondering if I might be doing something wrong or that the docs are just out of sync.

Author:David Martin,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/57792404/nrwl-nx-react-tutorial-confusing
yy