Skip to content

Latest commit

 

History

History
61 lines (31 loc) · 1.24 KB

project-creation-commands.md

File metadata and controls

61 lines (31 loc) · 1.24 KB

Project creation commands

⬅️ README

Steps

  1. creation command:

npx create-nx-workspace nx-hello

  1. add the react dev dependency to the nx workspace:

npm i --save-dev @nrwl/react

  1. create the first application (react, named as my-site) inside of the nx workspace:

nx generate @nrwl/react:app

  1. running the created (my-site) application:

nx serve my-site

  1. creating a reusable ui-header components library:

nx g @nrwl/react:lib ui-header

  1. creating a component inside of the ui_header components library:

nx g @nrwl/react:component --project=ui-header page-title

  1. check the dependencies graph

nx dep-graph

  1. add the nx express plugin

npm i --save-dev @nrwl/express

  1. list the express plugin app creation options

nx g @nrwl/express:app --help

  1. creating an api project that allows the access of frontend app my-site

nx g @nrwl/express:app api --frontendProject=my-site

  1. create an api-interface library to share the typescript interfaces

nx g @nrwl/workspace:lib api-interface

  1. check the dependencies graph

nx dep-graph

  1. update the API_URL on the api-interface library and check

nx affected:dep-graph

  1. run the unit tests against all the affected code

nx affected:test