Skip to content

rpd10/nxconf2022

Repository files navigation

Nx Conf 2022 - Workspace Guardrails

Google Slides

This repo contains all of the configuration for the examples shown in the presentation above.

Click the Actions tab above to check out the GitHub Actions CI workflows, also linked below.

workspace-lint

https://nx.dev/nx/workspace-lint

The demo/workspace-lint branch and this pull request show how you can prevent unexpected behavior by running npx nx workspace-lint in CI.

See the following files for where we're applying that check:

@nrwl/nx/enforce-module-boundaries

https://nx.dev/core-features/enforce-project-boundaries

The demo/enforce-module-boundaries branch and this pull request show how we can use these ESLint rules to enforce structure on our dependency graph.

Workspace Lint Rules

https://nx.dev/packages/linter/generators/workspace-rule

The demo/workspace-eslint branch and this pull request show how we can fail a PR if the code doesn't meet our custom ESLint rule.

Code Owners

Though I didn't really touch on it in the presentation (and it's not setup in this demo repo), all of these checks are meaningless if engineers can easily sidestep them. To prevent that, we use GitHub's CODEOWNERS feature to apply a layer of protection to the Nx configuration files like the eslintrc.json and our CI configuration.

About

Demo repository for the Workspace Guardrails lightning talk at Nx Conf 2022

Resources

Stars

Watchers

Forks