Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Managing Monorepos with Nx - Nrwl/Nxの近況 -

puku0x
February 19, 2020

Managing Monorepos with Nx - Nrwl/Nxの近況 -

puku0x

February 19, 2020
Tweet

More Decks by puku0x

Other Decks in Technology

Transcript

  1. Nx • Developed by Nrwl • Monorepo management tool ◦

    Modern web development ◦ Effective change detection ◦ Automated migration 6 “Develop like Google, Facebook and Microsoft”
  2. Version histories • v1.x〜(April, 2018) ◦ Extensions for Angular CLI

    • v6.x ◦ Jest support • v7.x ◦ Cypress and Nest support • v8.x ◦ React, Next.js and Storybook support • v9.x ◦ Angular v9 support 7
  3. $ npx create-nx-workspace : ? Workspace name (e.g., org name)

    workspace ? What to create in the new workspace angular-nest ? Application name web ? Default stylesheet format SASS(.scss) Creating a workspace 8
  4. Nx workspace • Similar to Angular workspace • Single version

    policy ◦ package.json is a single source of truth 9
  5. Scaffolding • Applications ◦ nx g @nrwl/angular:app • Libraries ◦

    nx g @nrwl/angular:lib • Schematics ◦ nx g workspace-schematic 10
  6. $ npm i -D @nrwl/storybook $ npm i -D @storybook/angular

    @storybook/addon-knobs $ nx g @nrwl/angular:storybook-configuration # Run storybook $ nx run project-name:storybook # E2E with Cypress $ nx e2e project-name-e2e Storybook 12
  7. Linting/Formatting • ESLint/TSLint ◦ nx lint ◦ nx workspace-lint •

    Prettier ◦ nx format:write ◦ '--uncommitted' option for lint-staged 13
  8. Nx ecosystem • Nx Console ◦ VS Code extension •

    Nx Plugin ◦ Custom builder • Nx Cloud ◦ Cloud distributed caching 18 https://nx.dev/nx-console
  9. Nx v10 • https://github.com/nrwl/nx/issues/2152 ◦ Stability ◦ Smarter affected ◦

    Distributed caching by default ◦ Mixing monorepo and polyrepo 19
  10. Recap • Nx makes managing monorepos easy! ◦ Supports ◦

    https://nx.dev/ • Try it now! 20 $ npx create-nx-workspace