@nx/detox - Migrations
For an overview of the plugin and setup instructions, see the @nx/detox introduction.
The @nx/detox plugin provides various migrations to help you migrate to newer versions of detox projects within your Nx workspace. Below is a complete reference for all available migrations.
24.0.x
Section titled “24.0.x”remove-deprecated-executors
Section titled “remove-deprecated-executors”Version: 24.0.0-beta.3
Converts targets using the removed @nx/detox executors to inferred tasks; an AI prompt finishes the targets the converter cannot convert safely and validates the project graph.
Convert @nx/detox build and test targets to inferred tasks
Section titled “Convert @nx/detox build and test targets to inferred tasks”Nx 24 removes the @nx/detox:build and @nx/detox:test executors and their @nrwl aliases. The migration registers @nx/detox/plugin in nx.json and converts the targets that use those executors to inferred tasks. Each converted target runs the inferred build or test target and passes its Detox configuration as an argument. A target with nothing left to override is removed from project configuration. When several projects share the same remaining options, those options move to a targetDefaults entry scoped to the plugin. targetDefaults entries keyed by a removed executor are removed once no target uses that executor.
The migration lists the targets the converter cannot convert safely. In agentic runs, an AI prompt finishes them and validates the project graph.
Sample code changes
Section titled “Sample code changes”Before
Section titled “Before”{ "name": "demo-e2e", "targets": { "build-android": { "executor": "@nx/detox:build", "options": { "detoxConfiguration": "android.emu.debug" }, "configurations": { "production": { "detoxConfiguration": "android.emu.release" } } }, "test-android": { "executor": "@nx/detox:test", "options": { "detoxConfiguration": "android.emu.debug", "buildTarget": "demo-e2e:build-android" }, "configurations": { "production": { "detoxConfiguration": "android.emu.release", "buildTarget": "demo-e2e:build-android:production" } } } }}{ "name": "demo-e2e", "targets": { "build-android": { "command": "nx run demo-e2e:build", "configurations": { "production": { "args": ["--args=\"-c android.emu.release\""] } }, "options": { "args": ["--args=\"-c android.emu.debug\""] } }, "test-android": { "command": "nx run demo-e2e:test", "configurations": { "production": { "args": ["--args=\"-c android.emu.release\""] } }, "dependsOn": ["demo-e2e:build-android"], "options": { "args": ["--args=\"-c android.emu.debug\""] } } }}{ "plugins": [ { "plugin": "@nx/detox/plugin", "options": { "buildTargetName": "build", "startTargetName": "start", "testTargetName": "test" } } ]}23.0.x
Section titled “23.0.x”update-23-0-0-migrate-create-nodes-v2-import
Section titled “update-23-0-0-migrate-create-nodes-v2-import”Version: 23.0.0-beta.24
Rename imports of createNodesV2 from @nx/detox/plugin to the canonical createNodes export.
Rename createNodesV2 imports to createNodes
Section titled “Rename createNodesV2 imports to createNodes”@nx/detox renamed its primary inferred-plugin export from createNodesV2 to createNodes. The createNodesV2 name is preserved as a deprecated alias for now, but new code should use createNodes.
This migration scans every .ts, .tsx, .cts, and .mts file in your workspace and rewrites named imports and re-exports of createNodesV2 from @nx/detox/plugin to createNodes.
Sample Code Changes
Section titled “Sample Code Changes”Before
Section titled “Before”import { createNodesV2 } from '@nx/detox/plugin';import { createNodes } from '@nx/detox/plugin';Aliases are preserved (createNodesV2 as cn becomes createNodes as cn), and if a file already imports both names ({ createNodes, createNodesV2 }) the redundant binding is dropped.
What is not rewritten
Section titled “What is not rewritten”Only static import/export named bindings from @nx/detox/plugin are rewritten. Namespace imports, dynamic import(...), require(...) destructuring, and property access such as plugin.createNodesV2 are left untouched — they keep working through the createNodesV2 runtime alias. Update those by hand if you want to drop the deprecated name everywhere.
22.2.x
Section titled “22.2.x”update-22-0-0-remove-config-plugins-detox-for-expo-54
Section titled “update-22-0-0-remove-config-plugins-detox-for-expo-54”Version: 22.2.0-beta.2
Remove @config-plugins/detox for Expo 54+ projects (package discontinued)
Requires
Section titled “Requires”| Name | Version |
|---|---|
expo | >= 54.0.0 |
22.0.x
Section titled “22.0.x”22.0.0-package-updates
Section titled “22.0.0-package-updates”Version: 22.0.0-beta.5
Packages
Section titled “Packages”The following packages will be updated:
| Name | Version | Always add to package.json |
|---|---|---|
detox | ~20.43.0 | Updated only |
@testing-library/jest-dom | ~6.9.1 | Updated only |
22.0.0-config-plugins-detox-package-updates
Section titled “22.0.0-config-plugins-detox-package-updates”Version: 22.0.0-beta.5
Packages
Section titled “Packages”The following packages will be updated:
| Name | Version | Always add to package.json |
|---|---|---|
@config-plugins/detox | ~11.0.0 | Updated only |