@nx/detox 22.2.0-canary.20251202-30acb10 → 22.2.0-canary.20251203-2e442d5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +11 -1
- package/package.json +8 -7
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +11 -0
- package/src/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.d.ts +12 -0
- package/src/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.d.ts.map +1 -0
- package/src/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.js +57 -0
- package/src/utils/expo-version-utils.d.ts +10 -0
- package/src/utils/expo-version-utils.d.ts.map +1 -0
- package/src/utils/expo-version-utils.js +28 -0
package/migrations.json
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generators": {
|
|
2
|
+
"generators": {
|
|
3
|
+
"update-22-0-0-remove-config-plugins-detox-for-expo-54": {
|
|
4
|
+
"requires": {
|
|
5
|
+
"expo": ">= 54.0.0"
|
|
6
|
+
},
|
|
7
|
+
"version": "22.2.0-beta.2",
|
|
8
|
+
"cli": "nx",
|
|
9
|
+
"description": "Remove @config-plugins/detox for Expo 54+ projects (package discontinued)",
|
|
10
|
+
"factory": "./src/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
3
13
|
"packageJsonUpdates": {
|
|
4
14
|
"20.3.0": {
|
|
5
15
|
"version": "20.3.0-beta.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/detox",
|
|
3
|
-
"version": "22.2.0-canary.
|
|
3
|
+
"version": "22.2.0-canary.20251203-2e442d5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"main": "./index.js",
|
|
28
28
|
"types": "index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nx/devkit": "22.2.0-canary.
|
|
31
|
-
"@nx/jest": "22.2.0-canary.
|
|
32
|
-
"@nx/js": "22.2.0-canary.
|
|
33
|
-
"@nx/eslint": "22.2.0-canary.
|
|
34
|
-
"@nx/react": "22.2.0-canary.
|
|
30
|
+
"@nx/devkit": "22.2.0-canary.20251203-2e442d5",
|
|
31
|
+
"@nx/jest": "22.2.0-canary.20251203-2e442d5",
|
|
32
|
+
"@nx/js": "22.2.0-canary.20251203-2e442d5",
|
|
33
|
+
"@nx/eslint": "22.2.0-canary.20251203-2e442d5",
|
|
34
|
+
"@nx/react": "22.2.0-canary.20251203-2e442d5",
|
|
35
|
+
"semver": "^7.6.3",
|
|
35
36
|
"tslib": "^2.3.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"nx": "22.2.0-canary.
|
|
39
|
+
"nx": "22.2.0-canary.20251203-2e442d5"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"detox": "^20.9.0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,IAAI,EAAE,MAAM,YAAY,CAAC;AASjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,IAAI,EAAE,MAAM,YAAY,CAAC;AASjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAUlC,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mDAMzE;AAED,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,mDA6Df;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -13,6 +13,7 @@ const normalize_options_1 = require("./lib/normalize-options");
|
|
|
13
13
|
const ensure_dependencies_1 = require("./lib/ensure-dependencies");
|
|
14
14
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
15
15
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
16
|
+
const expo_version_utils_1 = require("../../utils/expo-version-utils");
|
|
16
17
|
async function detoxApplicationGenerator(host, schema) {
|
|
17
18
|
return await detoxApplicationGeneratorInternal(host, {
|
|
18
19
|
addPlugin: false,
|
|
@@ -27,6 +28,16 @@ async function detoxApplicationGeneratorInternal(host, schema) {
|
|
|
27
28
|
skipFormat: true,
|
|
28
29
|
});
|
|
29
30
|
const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
31
|
+
// Validate Expo version compatibility
|
|
32
|
+
// @config-plugins/detox was discontinued and is incompatible with Expo 54+
|
|
33
|
+
// See: https://github.com/expo/config-plugins/pull/290
|
|
34
|
+
if (options.framework === 'expo' && (0, expo_version_utils_1.isExpoV54OrAbove)(host)) {
|
|
35
|
+
throw new Error(`Detox with Expo 54+ is not supported. The @config-plugins/detox package has been discontinued ` +
|
|
36
|
+
`and is incompatible with Expo 54. Please consider one of the following alternatives:\n` +
|
|
37
|
+
` - Use framework: 'react-native' instead of 'expo'\n` +
|
|
38
|
+
` - Use Maestro for E2E testing (recommended by Expo): https://docs.expo.dev/build-reference/e2e-tests/\n` +
|
|
39
|
+
` - Stay on Expo 53 if you need Detox support`);
|
|
40
|
+
}
|
|
30
41
|
const initTask = await (0, init_1.default)(host, {
|
|
31
42
|
...options,
|
|
32
43
|
skipFormat: true,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Remove @config-plugins/detox for Expo 54+ projects.
|
|
4
|
+
*
|
|
5
|
+
* The @config-plugins/detox package has been discontinued and is incompatible
|
|
6
|
+
* with Expo 54. See: https://github.com/expo/config-plugins/pull/290
|
|
7
|
+
*
|
|
8
|
+
* This migration removes the dependency from package.json for projects
|
|
9
|
+
* using Expo 54 or above.
|
|
10
|
+
*/
|
|
11
|
+
export default function update(tree: Tree): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=remove-config-plugins-detox-for-expo-54.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-config-plugins-detox-for-expo-54.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA6C,MAAM,YAAY,CAAC;AAG7E;;;;;;;;GAQG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBA4D9C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
/**
|
|
7
|
+
* Remove @config-plugins/detox for Expo 54+ projects.
|
|
8
|
+
*
|
|
9
|
+
* The @config-plugins/detox package has been discontinued and is incompatible
|
|
10
|
+
* with Expo 54. See: https://github.com/expo/config-plugins/pull/290
|
|
11
|
+
*
|
|
12
|
+
* This migration removes the dependency from package.json for projects
|
|
13
|
+
* using Expo 54 or above.
|
|
14
|
+
*/
|
|
15
|
+
async function update(tree) {
|
|
16
|
+
const rootPackageJsonPath = 'package.json';
|
|
17
|
+
if (!tree.exists(rootPackageJsonPath)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const packageJson = (0, devkit_1.readJson)(tree, rootPackageJsonPath);
|
|
21
|
+
// Check if @config-plugins/detox is installed
|
|
22
|
+
const hasConfigPluginsDetox = packageJson.dependencies?.['@config-plugins/detox'] ||
|
|
23
|
+
packageJson.devDependencies?.['@config-plugins/detox'];
|
|
24
|
+
if (!hasConfigPluginsDetox) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// Check the installed Expo version
|
|
28
|
+
const expoVersion = packageJson.dependencies?.['expo'] || packageJson.devDependencies?.['expo'];
|
|
29
|
+
if (!expoVersion) {
|
|
30
|
+
// No expo installed, this is likely a React Native project, skip
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const cleanedVersion = (0, semver_1.clean)(expoVersion) ?? (0, semver_1.coerce)(expoVersion)?.version;
|
|
34
|
+
if (!cleanedVersion) {
|
|
35
|
+
devkit_1.logger.warn(`Could not parse Expo version "${expoVersion}". Skipping @config-plugins/detox removal.`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const majorVersion = (0, semver_1.major)(cleanedVersion);
|
|
39
|
+
if (majorVersion < 54) {
|
|
40
|
+
// Expo 53 or below still supports @config-plugins/detox
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Remove @config-plugins/detox from package.json
|
|
44
|
+
(0, devkit_1.updateJson)(tree, rootPackageJsonPath, (json) => {
|
|
45
|
+
if (json.dependencies?.['@config-plugins/detox']) {
|
|
46
|
+
delete json.dependencies['@config-plugins/detox'];
|
|
47
|
+
}
|
|
48
|
+
if (json.devDependencies?.['@config-plugins/detox']) {
|
|
49
|
+
delete json.devDependencies['@config-plugins/detox'];
|
|
50
|
+
}
|
|
51
|
+
return json;
|
|
52
|
+
});
|
|
53
|
+
devkit_1.logger.warn(`Removed @config-plugins/detox from package.json.\n` +
|
|
54
|
+
`The @config-plugins/detox package has been discontinued and is incompatible with Expo 54+.\n` +
|
|
55
|
+
`For E2E testing with Expo 54+, consider using Maestro: https://docs.expo.dev/build-reference/e2e-tests/`);
|
|
56
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tree } from 'nx/src/generators/tree';
|
|
2
|
+
/**
|
|
3
|
+
* Get the installed Expo version from package.json.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getInstalledExpoVersion(tree: Tree): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Check if the workspace is using Expo v54 or above.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isExpoV54OrAbove(tree: Tree): boolean;
|
|
10
|
+
//# sourceMappingURL=expo-version-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/detox/src/utils/expo-version-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGnD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAiBjE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAMpD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInstalledExpoVersion = getInstalledExpoVersion;
|
|
4
|
+
exports.isExpoV54OrAbove = isExpoV54OrAbove;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const semver_1 = require("semver");
|
|
7
|
+
/**
|
|
8
|
+
* Get the installed Expo version from package.json.
|
|
9
|
+
*/
|
|
10
|
+
function getInstalledExpoVersion(tree) {
|
|
11
|
+
const installedExpoVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'expo');
|
|
12
|
+
if (!installedExpoVersion ||
|
|
13
|
+
installedExpoVersion === 'latest' ||
|
|
14
|
+
installedExpoVersion === 'beta') {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return ((0, semver_1.clean)(installedExpoVersion) ?? (0, semver_1.coerce)(installedExpoVersion)?.version ?? null);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Check if the workspace is using Expo v54 or above.
|
|
21
|
+
*/
|
|
22
|
+
function isExpoV54OrAbove(tree) {
|
|
23
|
+
const installedExpoVersion = getInstalledExpoVersion(tree);
|
|
24
|
+
if (!installedExpoVersion) {
|
|
25
|
+
return true; // No Expo installed or new project, default to latest (v54+)
|
|
26
|
+
}
|
|
27
|
+
return (0, semver_1.major)(installedExpoVersion) >= 54;
|
|
28
|
+
}
|