Skip to main content

Command Palette

Search for a command to run...

🍒 Cherry-Picked Nx v18.2 Updates

Exploring My Selected Features from Nx Releases

Updated
2 min read
🍒 Cherry-Picked Nx v18.2 Updates
J

Who am I? Whether it's as a Software Engineer, Tech Lead, or Architect, if it involves software development, I'm in! My journey began in the realm of Java development, but I fully transitioned into the universe of JavaScript/TypeScript and its exciting toolset. I support companies through their software development cycle challenges by utilizing Nx monorepos, micro frontends, robust testing strategies, and a touch of Extreme Programming philosophy. Every day for me is like waiting for the next episode of my favorite series—filled with learning, sharing, and growing together. Indeed, I'm as passionate about coaching and sharing knowledge as I am about coding. I am the father of two incredible boys, and I am endlessly grateful to my wife for supporting my passion every day.

[Angular] Support Angular 17.3

As usual, Nx is up to date with the latest version of Angular!

[Core] Scope Nx Plugin Project Crystal 💛💛💛

In my previous article, “⛔ Target Exclusions in Nx Project Crystal,” I introduced alternatives for excluding certain projects from specific plugins.

For instance, you might not want a test target in an e2e project simply because there’s a jest.config.ts file present.

Now, an official method is available for excluding or including plugins for a specific project. Within your nx.json file, you can now specify the exclude or include options:

{
  "plugins": [
    {
      "plugin": "@nx/jest/plugin",
      "options": {
        "targetName": "test",
        "exclude": ["my-lib-e2e/**/*"]
      }
    }
  ]
}

[Gradle] New Gradle Integration

You can now leverage the new Gradle integration with the @nx/gradle:init generator. To initialize, simply run:

nx g @nx/gradle:init

This initialization will also add the @nx/gradle/plugin to your nx.json:

{
  "plugins": [
    {
      "plugin": "@nx/gradle/plugin",
      "options": {
        "testTargetName": "build",
        "classesTargetName": "test",
        "buildTargetName": "classes"
      }
    }
  ]
}

This plugin will:

  • Integrate your Gradle projects into the Nx Dependency Tree by scanning all Gradle configurations.

  • Discover your projects by scanning the Gradle configuration matching the pattern **/build.{gradle.kts,gradle}, and then assign the targets build, test, and classes.

[Cypress] New targetopen-cypress is added by the @nx/cypress/plugin

If you’re working with Nx Project Crystal and have a Cypress project that includes a cypress.config.* file, the @nx/cypress/pluginwill automatically add related targets to your project.

A new target, open-cypress, will now be added to your project configuration:

"open-cypress": {
  "command": "cypress open",
  "options": {
    "cwd": ".",
  },

You have the flexibility to use a different name by specifying the new plugin option openTargetName:

{
  "plugins": [
    {
      "plugin": "@nx/cypress/plugin",
      "options": {
        "targetName": "e2e",
        "ciTargetName": "e2e-ci",
        "componentTestingTargetName": "component-test",
        "openTargetName": "open-cypress" // <-- NEW
      }
    }
  ]
}