- creation command:
npx create-nx-workspace nx-hello
- add the react dev dependency to the nx workspace:
npm i --save-dev @nrwl/react
- create the first application (react, named as my-site) inside of the nx workspace:
nx generate @nrwl/react:app
- running the created (my-site) application:
nx serve my-site
- creating a reusable ui-header components library:
nx g @nrwl/react:lib ui-header
- creating a component inside of the ui_header components library:
nx g @nrwl/react:component --project=ui-header page-title
- check the dependencies graph
nx dep-graph
- add the nx express plugin
npm i --save-dev @nrwl/express
- list the express plugin app creation options
nx g @nrwl/express:app --help
- creating an api project that allows the access of frontend app my-site
nx g @nrwl/express:app api --frontendProject=my-site
- create an api-interface library to share the typescript interfaces
nx g @nrwl/workspace:lib api-interface
- check the dependencies graph
nx dep-graph
- update the API_URL on the api-interface library and check
nx affected:dep-graph
- run the unit tests against all the affected code
nx affected:test