@nx/react-native 21.4.0-beta.10 → 21.4.0-beta.12
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/.eslintrc.json +2 -1
- package/generators.json +0 -5
- package/migrations.json +85 -0
- package/package.json +13 -14
- package/plugins/metro-resolver.d.ts.map +1 -1
- package/plugins/metro-resolver.js +26 -8
- package/plugins/with-nx-metro.d.ts +2 -2
- package/plugins/with-nx-metro.d.ts.map +1 -1
- package/plugins/with-nx-metro.js +18 -2
- package/src/executors/bundle/bundle.impl.d.ts.map +1 -1
- package/src/executors/bundle/bundle.impl.js +2 -2
- package/src/executors/storybook/storybook.impl.d.ts.map +1 -1
- package/src/executors/storybook/storybook.impl.js +3 -4
- package/src/generators/application/application.js +1 -1
- package/src/generators/application/files/app/android/app/build.gradle.template +2 -2
- package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +0 -1
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +1 -2
- package/src/generators/application/files/app/android/build.gradle.template +3 -3
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/src/generators/application/files/app/android/gradlew.template +2 -3
- package/src/generators/application/files/app/ios/.xcode.env.template +0 -1
- package/src/generators/application/files/app/ios/Podfile.template +0 -5
- package/src/generators/application/files/app/ios/__className__/AppDelegate.swift.template +48 -0
- package/src/generators/application/files/app/ios/__className__/PrivacyInfo.xcprivacy +31 -32
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +9 -192
- package/src/generators/application/files/app/package.json.template +3 -3
- package/src/generators/application/lib/add-project.d.ts.map +1 -1
- package/src/generators/application/lib/add-project.js +2 -0
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -0
- package/src/generators/library/library.js +1 -1
- package/src/generators/library/schema.json +1 -0
- package/src/generators/web-configuration/web-configuration.js +1 -1
- package/src/migrations/update-21-4-0/remove-deprecated-deps.d.ts +6 -0
- package/src/migrations/update-21-4-0/remove-deprecated-deps.d.ts.map +1 -0
- package/src/migrations/update-21-4-0/remove-deprecated-deps.js +27 -0
- package/src/migrations/update-21-4-0/upgrade-react-native-projects.d.ts +3 -0
- package/src/migrations/update-21-4-0/upgrade-react-native-projects.d.ts.map +1 -0
- package/src/migrations/update-21-4-0/upgrade-react-native-projects.js +30 -0
- package/src/utils/add-jest.d.ts +1 -1
- package/src/utils/add-jest.d.ts.map +1 -1
- package/src/utils/add-jest.js +3 -2
- package/src/utils/add-linting.d.ts +1 -0
- package/src/utils/add-linting.d.ts.map +1 -1
- package/src/utils/add-linting.js +26 -0
- package/src/utils/ensure-dependencies.d.ts +1 -1
- package/src/utils/ensure-dependencies.d.ts.map +1 -1
- package/src/utils/ensure-dependencies.js +7 -5
- package/src/utils/react-native-project-detection.d.ts +15 -0
- package/src/utils/react-native-project-detection.d.ts.map +1 -0
- package/src/utils/react-native-project-detection.js +111 -0
- package/src/utils/versions.d.ts +18 -19
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +19 -20
- package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +0 -30
- package/src/generators/application/files/app/android/app/src/main/res/xml/network_security_config.xml +0 -7
- package/src/generators/application/files/app/ios/__className__/AppDelegate.h +0 -6
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +0 -31
- package/src/generators/application/files/app/ios/__className__/main.m +0 -10
- package/src/generators/application/files/app/ios/__className__Tests/Info.plist +0 -24
- package/src/generators/application/files/app/ios/__className__Tests/__className__Tests.m +0 -66
- package/src/generators/upgrade-native/lib/create-native-files.d.ts +0 -4
- package/src/generators/upgrade-native/lib/create-native-files.d.ts.map +0 -1
- package/src/generators/upgrade-native/lib/create-native-files.js +0 -13
- package/src/generators/upgrade-native/lib/normalize-options.d.ts +0 -13
- package/src/generators/upgrade-native/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/upgrade-native/lib/normalize-options.js +0 -26
- package/src/generators/upgrade-native/schema.d.ts +0 -9
- package/src/generators/upgrade-native/schema.json +0 -41
- package/src/generators/upgrade-native/upgrade-native.d.ts +0 -11
- package/src/generators/upgrade-native/upgrade-native.d.ts.map +0 -1
- package/src/generators/upgrade-native/upgrade-native.js +0 -30
|
@@ -4,24 +4,26 @@ exports.ensureDependencies = ensureDependencies;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("@nx/react/src/utils/versions");
|
|
6
6
|
const versions_2 = require("./versions");
|
|
7
|
-
function ensureDependencies(tree) {
|
|
7
|
+
function ensureDependencies(tree, unitTestRunner) {
|
|
8
8
|
const isPnpm = (0, devkit_1.detectPackageManager)(tree.root) === 'pnpm';
|
|
9
9
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
10
10
|
'@types/node': versions_2.typesNodeVersion,
|
|
11
11
|
'@types/react': versions_2.typesReactVersion,
|
|
12
12
|
'@react-native/babel-preset': versions_2.reactNativeBabelPresetVersion,
|
|
13
13
|
'@react-native/metro-config': versions_2.reactNativeMetroConfigVersion,
|
|
14
|
-
'@testing-library/react-native': versions_2.testingLibraryReactNativeVersion,
|
|
15
|
-
'@testing-library/jest-native': versions_2.testingLibraryJestNativeVersion,
|
|
16
14
|
'@react-native-community/cli': versions_2.reactNativeCommunityCliVersion,
|
|
17
15
|
'@react-native-community/cli-platform-android': versions_2.reactNativeCommunityCliPlatformAndroidVersion,
|
|
18
16
|
'@react-native-community/cli-platform-ios': versions_2.reactNativeCommunityCliPlatformIosVersion,
|
|
19
|
-
'jest-react-native': versions_2.jestReactNativeVersion,
|
|
20
|
-
'react-test-renderer': versions_2.reactTestRendererVersion,
|
|
21
17
|
'react-native-svg-transformer': versions_2.reactNativeSvgTransformerVersion,
|
|
22
18
|
'react-native-svg': versions_2.reactNativeSvgVersion,
|
|
23
19
|
'@babel/preset-react': versions_1.babelPresetReactVersion,
|
|
24
20
|
'@babel/core': versions_1.babelCoreVersion,
|
|
21
|
+
...(unitTestRunner === 'jest'
|
|
22
|
+
? {
|
|
23
|
+
'@testing-library/react-native': versions_2.testingLibraryReactNativeVersion,
|
|
24
|
+
'react-test-renderer': versions_2.reactTestRendererVersion,
|
|
25
|
+
}
|
|
26
|
+
: {}),
|
|
25
27
|
...(isPnpm
|
|
26
28
|
? {
|
|
27
29
|
'@babel/runtime': versions_2.babelRuntimeVersion, // @babel/runtime is used by react-native-svg
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
export interface ReactNativeProjectDetectionResult {
|
|
3
|
+
isReactNative: boolean;
|
|
4
|
+
reason?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Determines if a project is a React Native project by checking for specific files
|
|
8
|
+
* and ensuring it's not an Expo project
|
|
9
|
+
*/
|
|
10
|
+
export declare function isReactNativeProject(tree: Tree, projectRoot: string): Promise<ReactNativeProjectDetectionResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Gets all React Native projects in the workspace
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAllReactNativeProjects(tree: Tree, projects: Map<string, any>): Promise<string[]>;
|
|
15
|
+
//# sourceMappingURL=react-native-project-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-project-detection.d.ts","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/react-native-project-detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAqB,MAAM,YAAY,CAAC;AAGrD,MAAM,WAAW,iCAAiC;IAChD,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAWD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iCAAiC,CAAC,CAiG5C;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isReactNativeProject = isReactNativeProject;
|
|
4
|
+
exports.getAllReactNativeProjects = getAllReactNativeProjects;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
7
|
+
async function getAppConfig(tree, projectRoot, appConfigPath) {
|
|
8
|
+
const absolutePath = (0, devkit_1.joinPathFragments)(tree.root, projectRoot, appConfigPath);
|
|
9
|
+
return (0, config_utils_1.loadConfigFile)(absolutePath);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Determines if a project is a React Native project by checking for specific files
|
|
13
|
+
* and ensuring it's not an Expo project
|
|
14
|
+
*/
|
|
15
|
+
async function isReactNativeProject(tree, projectRoot) {
|
|
16
|
+
// Check for required files
|
|
17
|
+
const requiredFiles = ['metro.config.js', 'package.json'];
|
|
18
|
+
const appConfigFiles = ['app.json', 'app.config.js', 'app.config.ts'];
|
|
19
|
+
// Check if all required files exist
|
|
20
|
+
for (const file of requiredFiles) {
|
|
21
|
+
const filePath = (0, devkit_1.joinPathFragments)(projectRoot, file);
|
|
22
|
+
if (!tree.exists(filePath)) {
|
|
23
|
+
return {
|
|
24
|
+
isReactNative: false,
|
|
25
|
+
reason: `Missing required file: ${file}`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Check if at least one app config file exists
|
|
30
|
+
let appConfigExists = false;
|
|
31
|
+
let appConfigPath = null;
|
|
32
|
+
for (const file of appConfigFiles) {
|
|
33
|
+
const filePath = (0, devkit_1.joinPathFragments)(projectRoot, file);
|
|
34
|
+
if (tree.exists(filePath)) {
|
|
35
|
+
appConfigExists = true;
|
|
36
|
+
appConfigPath = filePath;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (!appConfigExists) {
|
|
41
|
+
return {
|
|
42
|
+
isReactNative: false,
|
|
43
|
+
reason: 'Missing app config file (app.json, app.config.js, or app.config.ts)',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Read package.json to check for Expo dependencies
|
|
47
|
+
const packageJsonPath = (0, devkit_1.joinPathFragments)(projectRoot, 'package.json');
|
|
48
|
+
let packageJson;
|
|
49
|
+
try {
|
|
50
|
+
packageJson = JSON.parse(tree.read(packageJsonPath, 'utf-8'));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return {
|
|
54
|
+
isReactNative: false,
|
|
55
|
+
reason: 'Failed to parse package.json',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Check for Expo in dependencies
|
|
59
|
+
const hasExpoDependency = packageJson.dependencies?.['expo'] || packageJson.devDependencies?.['expo'];
|
|
60
|
+
if (hasExpoDependency) {
|
|
61
|
+
return {
|
|
62
|
+
isReactNative: false,
|
|
63
|
+
reason: 'Project has Expo dependency - this is an Expo project',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Read app config to check for Expo configuration
|
|
67
|
+
let appConfig;
|
|
68
|
+
let appConfigParseFailed = false;
|
|
69
|
+
if (appConfigPath) {
|
|
70
|
+
// Extract just the filename from the full path
|
|
71
|
+
const filename = appConfigPath.split('/').pop();
|
|
72
|
+
try {
|
|
73
|
+
appConfig = await getAppConfig(tree, projectRoot, filename);
|
|
74
|
+
if (appConfig === null) {
|
|
75
|
+
appConfigParseFailed = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
appConfigParseFailed = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (appConfigParseFailed) {
|
|
83
|
+
return {
|
|
84
|
+
isReactNative: false,
|
|
85
|
+
reason: 'Failed to parse app config file',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Check if app config has Expo configuration
|
|
89
|
+
if (appConfig.expo) {
|
|
90
|
+
return {
|
|
91
|
+
isReactNative: false,
|
|
92
|
+
reason: 'App config has Expo configuration',
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
isReactNative: true,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Gets all React Native projects in the workspace
|
|
101
|
+
*/
|
|
102
|
+
async function getAllReactNativeProjects(tree, projects) {
|
|
103
|
+
const reactNativeProjects = [];
|
|
104
|
+
for (const [projectName, project] of projects.entries()) {
|
|
105
|
+
const detection = await isReactNativeProject(tree, project.root);
|
|
106
|
+
if (detection.isReactNative) {
|
|
107
|
+
reactNativeProjects.push(projectName);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return reactNativeProjects;
|
|
111
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const reactNativeVersion = "~0.
|
|
2
|
+
export declare const reactNativeVersion = "~0.79.3";
|
|
3
3
|
export declare const typesNodeVersion = "18.16.9";
|
|
4
|
-
export declare const reactNativeCommunityCliVersion = "~
|
|
5
|
-
export declare const reactNativeCommunityCliPlatformAndroidVersion = "~
|
|
6
|
-
export declare const reactNativeCommunityCliPlatformIosVersion = "~
|
|
7
|
-
export declare const reactNativeBabelPresetVersion = "~0.
|
|
8
|
-
export declare const reactNativeMetroConfigVersion = "~0.
|
|
9
|
-
export declare const reactNativeWebVersion = "~0.
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const typesReactVersion = "~
|
|
14
|
-
export declare const typesReactDomVersion = "~
|
|
15
|
-
export declare const testingLibraryReactNativeVersion = "~
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const babelRuntimeVersion = "~7.26.0";
|
|
4
|
+
export declare const reactNativeCommunityCliVersion = "~18.0.0";
|
|
5
|
+
export declare const reactNativeCommunityCliPlatformAndroidVersion = "~18.0.0";
|
|
6
|
+
export declare const reactNativeCommunityCliPlatformIosVersion = "~18.0.0";
|
|
7
|
+
export declare const reactNativeBabelPresetVersion = "~0.79.3";
|
|
8
|
+
export declare const reactNativeMetroConfigVersion = "~0.79.3";
|
|
9
|
+
export declare const reactNativeWebVersion = "~0.20.0";
|
|
10
|
+
export declare const metroVersion = "~0.82.4";
|
|
11
|
+
export declare const reactVersion = "19.0.0";
|
|
12
|
+
export declare const reactDomVersion = "19.0.0";
|
|
13
|
+
export declare const typesReactVersion = "~19.0.10";
|
|
14
|
+
export declare const typesReactDomVersion = "~19.0.6";
|
|
15
|
+
export declare const testingLibraryReactNativeVersion = "~13.2.0";
|
|
16
|
+
export declare const reactTestRendererVersion = "~19.0.0";
|
|
17
|
+
export declare const reactNativeSvgTransformerVersion = "~1.5.1";
|
|
18
|
+
export declare const reactNativeSvgVersion = "~15.11.2";
|
|
19
|
+
export declare const reactNativeSvgWebVersion = "~1.0.9";
|
|
20
|
+
export declare const babelRuntimeVersion = "~7.27.6";
|
|
22
21
|
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,8BAA8B,YAAY,CAAC;AACxD,eAAO,MAAM,6CAA6C,YAAY,CAAC;AACvE,eAAO,MAAM,yCAAyC,YAAY,CAAC;AAEnE,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,8BAA8B,YAAY,CAAC;AACxD,eAAO,MAAM,6CAA6C,YAAY,CAAC;AACvE,eAAO,MAAM,yCAAyC,YAAY,CAAC;AAEnE,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,YAAY,WAAW,CAAC;AACrC,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,eAAO,MAAM,gCAAgC,YAAY,CAAC;AAC1D,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,eAAO,MAAM,gCAAgC,WAAW,CAAC;AACzD,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAChD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.babelRuntimeVersion = exports.
|
|
3
|
+
exports.babelRuntimeVersion = exports.reactNativeSvgWebVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.testingLibraryReactNativeVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactDomVersion = exports.reactVersion = exports.metroVersion = exports.reactNativeWebVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeCommunityCliPlatformIosVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.reactNativeCommunityCliVersion = exports.typesNodeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.reactNativeVersion = '~0.
|
|
5
|
+
exports.reactNativeVersion = '~0.79.3';
|
|
6
6
|
exports.typesNodeVersion = '18.16.9';
|
|
7
|
-
exports.reactNativeCommunityCliVersion = '~
|
|
8
|
-
exports.reactNativeCommunityCliPlatformAndroidVersion = '~
|
|
9
|
-
exports.reactNativeCommunityCliPlatformIosVersion = '~
|
|
10
|
-
exports.reactNativeBabelPresetVersion = '~0.
|
|
11
|
-
exports.reactNativeMetroConfigVersion = '~0.
|
|
12
|
-
exports.reactNativeWebVersion = '~0.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.typesReactVersion = '~
|
|
17
|
-
exports.typesReactDomVersion = '~
|
|
18
|
-
exports.testingLibraryReactNativeVersion = '~
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.babelRuntimeVersion = '~7.26.0';
|
|
7
|
+
exports.reactNativeCommunityCliVersion = '~18.0.0';
|
|
8
|
+
exports.reactNativeCommunityCliPlatformAndroidVersion = '~18.0.0';
|
|
9
|
+
exports.reactNativeCommunityCliPlatformIosVersion = '~18.0.0';
|
|
10
|
+
exports.reactNativeBabelPresetVersion = '~0.79.3';
|
|
11
|
+
exports.reactNativeMetroConfigVersion = '~0.79.3';
|
|
12
|
+
exports.reactNativeWebVersion = '~0.20.0';
|
|
13
|
+
exports.metroVersion = '~0.82.4';
|
|
14
|
+
exports.reactVersion = '19.0.0';
|
|
15
|
+
exports.reactDomVersion = '19.0.0';
|
|
16
|
+
exports.typesReactVersion = '~19.0.10';
|
|
17
|
+
exports.typesReactDomVersion = '~19.0.6';
|
|
18
|
+
exports.testingLibraryReactNativeVersion = '~13.2.0';
|
|
19
|
+
exports.reactTestRendererVersion = '~19.0.0';
|
|
20
|
+
exports.reactNativeSvgTransformerVersion = '~1.5.1';
|
|
21
|
+
exports.reactNativeSvgVersion = '~15.11.2';
|
|
22
|
+
exports.reactNativeSvgWebVersion = '~1.0.9';
|
|
23
|
+
exports.babelRuntimeVersion = '~7.27.6';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Replace "com.<%= lowerCaseName %>" here and below with your app's package name from the top of MainActivity.java
|
|
2
|
-
package com.<%= lowerCaseName %>;
|
|
3
|
-
|
|
4
|
-
import com.wix.detox.Detox;
|
|
5
|
-
import com.wix.detox.config.DetoxConfig;
|
|
6
|
-
|
|
7
|
-
import org.junit.Rule;
|
|
8
|
-
import org.junit.Test;
|
|
9
|
-
import org.junit.runner.RunWith;
|
|
10
|
-
|
|
11
|
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
12
|
-
import androidx.test.filters.LargeTest;
|
|
13
|
-
import androidx.test.rule.ActivityTestRule;
|
|
14
|
-
|
|
15
|
-
@RunWith(AndroidJUnit4.class)
|
|
16
|
-
@LargeTest
|
|
17
|
-
public class DetoxTest {
|
|
18
|
-
@Rule // (2)
|
|
19
|
-
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
|
|
20
|
-
|
|
21
|
-
@Test
|
|
22
|
-
public void runDetoxTests() {
|
|
23
|
-
DetoxConfig detoxConfig = new DetoxConfig();
|
|
24
|
-
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
|
|
25
|
-
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
|
|
26
|
-
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);
|
|
27
|
-
|
|
28
|
-
Detox.runTests(mActivityRule, detoxConfig);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<network-security-config>
|
|
3
|
-
<domain-config cleartextTrafficPermitted="true">
|
|
4
|
-
<domain includeSubdomains="true">10.0.2.2</domain>
|
|
5
|
-
<domain includeSubdomains="true">localhost</domain>
|
|
6
|
-
</domain-config>
|
|
7
|
-
</network-security-config>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#import "AppDelegate.h"
|
|
2
|
-
|
|
3
|
-
#import <React/RCTBundleURLProvider.h>
|
|
4
|
-
|
|
5
|
-
@implementation AppDelegate
|
|
6
|
-
|
|
7
|
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
8
|
-
{
|
|
9
|
-
self.moduleName = @"<%= className %>";
|
|
10
|
-
// You can add your custom initial props in the dictionary below.
|
|
11
|
-
// They will be passed down to the ViewController used by React Native.
|
|
12
|
-
self.initialProps = @{};
|
|
13
|
-
|
|
14
|
-
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
18
|
-
{
|
|
19
|
-
return [self bundleURL];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
- (NSURL *)bundleURL
|
|
23
|
-
{
|
|
24
|
-
#if DEBUG
|
|
25
|
-
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"<%= entryFileIos %>"];
|
|
26
|
-
#else
|
|
27
|
-
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
28
|
-
#endif
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>en</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>BNDL</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleSignature</key>
|
|
20
|
-
<string>????</string>
|
|
21
|
-
<key>CFBundleVersion</key>
|
|
22
|
-
<string>1</string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
#import <XCTest/XCTest.h>
|
|
3
|
-
|
|
4
|
-
#import <React/RCTLog.h>
|
|
5
|
-
#import <React/RCTRootView.h>
|
|
6
|
-
|
|
7
|
-
#define TIMEOUT_SECONDS 600
|
|
8
|
-
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
9
|
-
|
|
10
|
-
@interface <%= className %>Tests : XCTestCase
|
|
11
|
-
|
|
12
|
-
@end
|
|
13
|
-
|
|
14
|
-
@implementation <%= className %>Tests
|
|
15
|
-
|
|
16
|
-
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
|
17
|
-
{
|
|
18
|
-
if (test(view)) {
|
|
19
|
-
return YES;
|
|
20
|
-
}
|
|
21
|
-
for (UIView *subview in [view subviews]) {
|
|
22
|
-
if ([self findSubviewInView:subview matching:test]) {
|
|
23
|
-
return YES;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return NO;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
- (void)testRendersWelcomeScreen
|
|
30
|
-
{
|
|
31
|
-
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
32
|
-
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
33
|
-
BOOL foundElement = NO;
|
|
34
|
-
|
|
35
|
-
__block NSString *redboxError = nil;
|
|
36
|
-
#ifdef DEBUG
|
|
37
|
-
RCTSetLogFunction(
|
|
38
|
-
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
39
|
-
if (level >= RCTLogLevelError) {
|
|
40
|
-
redboxError = message;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
46
|
-
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
47
|
-
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
48
|
-
|
|
49
|
-
foundElement = [self findSubviewInView:vc.view
|
|
50
|
-
matching:^BOOL(UIView *view) {
|
|
51
|
-
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
52
|
-
return YES;
|
|
53
|
-
}
|
|
54
|
-
return NO;
|
|
55
|
-
}];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#ifdef DEBUG
|
|
59
|
-
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
63
|
-
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-native-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/upgrade-native/lib/create-native-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,IAAI,EAAE,MAAM,YAAY,CAAC;AAIpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAEzD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,4BAA4B,EACpC,cAAc,EAAE,MAAM,QAoBvB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNativeFiles = createNativeFiles;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const normalize_options_1 = require("./normalize-options");
|
|
7
|
-
function createNativeFiles(host, schema, appProjectRoot) {
|
|
8
|
-
const options = (0, normalize_options_1.normalizeOptions)(schema, appProjectRoot);
|
|
9
|
-
const iosProjectRoot = (0, devkit_1.joinPathFragments)(appProjectRoot, 'ios');
|
|
10
|
-
const androidProjectRoot = (0, devkit_1.joinPathFragments)(appProjectRoot, 'android');
|
|
11
|
-
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../../application/files/app/ios'), iosProjectRoot, options);
|
|
12
|
-
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../../application/files/app/android'), androidProjectRoot, options);
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { UpgradeNativeConfigureSchema } from '../schema';
|
|
2
|
-
export interface NormalizedSchema {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
className: string;
|
|
6
|
-
lowerCaseName: string;
|
|
7
|
-
entryFile: string;
|
|
8
|
-
entryFileIos: string;
|
|
9
|
-
e2eTestRunner: 'cypress' | 'playwright' | 'detox' | 'none';
|
|
10
|
-
offsetFromRoot: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function normalizeOptions(options: UpgradeNativeConfigureSchema, appProjectRoot: string): NormalizedSchema;
|
|
13
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/upgrade-native/lib/normalize-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;IAC3D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,4BAA4B,EACrC,cAAc,EAAE,MAAM,GACrB,gBAAgB,CAsBlB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function normalizeOptions(options, appProjectRoot // app root
|
|
6
|
-
) {
|
|
7
|
-
const { fileName, className } = (0, devkit_1.names)(options.name);
|
|
8
|
-
const entryFileIos = 'src/main';
|
|
9
|
-
const entryFile = options.js ? 'src/main.js' : 'src/main.tsx';
|
|
10
|
-
/**
|
|
11
|
-
* if options.name is "my-app"
|
|
12
|
-
* name: "my-app", className: 'MyApp', lowerCaseName: 'myapp', displayName: 'MyApp'
|
|
13
|
-
* if options.name is "myApp"
|
|
14
|
-
* name: "my-app", className: 'MyApp', lowerCaseName: 'myapp', displayName: 'MyApp'
|
|
15
|
-
*/
|
|
16
|
-
return {
|
|
17
|
-
name: fileName,
|
|
18
|
-
className,
|
|
19
|
-
lowerCaseName: className.toLowerCase(),
|
|
20
|
-
displayName: options.displayName || className,
|
|
21
|
-
entryFile,
|
|
22
|
-
entryFileIos,
|
|
23
|
-
e2eTestRunner: options.e2eTestRunner,
|
|
24
|
-
offsetFromRoot: (0, devkit_1.offsetFromRoot)(appProjectRoot),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Linter } from '@nx/eslint';
|
|
2
|
-
|
|
3
|
-
export interface UpgradeNativeConfigureSchema {
|
|
4
|
-
name: string;
|
|
5
|
-
displayName?: string;
|
|
6
|
-
js: boolean; // default is false
|
|
7
|
-
e2eTestRunner: 'cypress' | 'playwright' | 'detox' | 'none'; // default is cypress
|
|
8
|
-
install: boolean; // default is true
|
|
9
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxReactNativeUpgradeNativeConfigure",
|
|
5
|
-
"title": "React native upgrade native configuration",
|
|
6
|
-
"description": "Upgrade native iOS and Android code to latest.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"name": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "Application project name to upgrade native files.",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-dropdown": "project"
|
|
17
|
-
},
|
|
18
|
-
"displayName": {
|
|
19
|
-
"description": "The display name to show in the application. Defaults to name.",
|
|
20
|
-
"type": "string"
|
|
21
|
-
},
|
|
22
|
-
"js": {
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"description": "Generate JavaScript files rather than TypeScript files",
|
|
25
|
-
"default": false
|
|
26
|
-
},
|
|
27
|
-
"e2eTestRunner": {
|
|
28
|
-
"description": "Adds the specified e2e test runner.",
|
|
29
|
-
"type": "string",
|
|
30
|
-
"enum": ["cypress", "playwright", "detox", "none"],
|
|
31
|
-
"default": "cypress"
|
|
32
|
-
},
|
|
33
|
-
"install": {
|
|
34
|
-
"type": "boolean",
|
|
35
|
-
"description": "Runs `pod install` for native modules before building iOS app.",
|
|
36
|
-
"default": true,
|
|
37
|
-
"x-priority": "internal"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"required": ["name"]
|
|
41
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated use `nx run @nx/react-native:upgrade` instead.
|
|
3
|
-
* TODO (@xiongemi): remove this generator for nx v19
|
|
4
|
-
* This function is a destructive command that replace React Native iOS and Android code with latest.
|
|
5
|
-
* It would replace the Android and iOS folder entirely.
|
|
6
|
-
*/
|
|
7
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
8
|
-
import { UpgradeNativeConfigureSchema } from './schema';
|
|
9
|
-
export declare function reactNativeUpgradeNativeGenerator(host: Tree, schema: UpgradeNativeConfigureSchema): Promise<GeneratorCallback>;
|
|
10
|
-
export default reactNativeUpgradeNativeGenerator;
|
|
11
|
-
//# sourceMappingURL=upgrade-native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-native.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/upgrade-native/upgrade-native.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,iBAAiB,EAIjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CA6B5B;AAED,eAAe,iCAAiC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use `nx run @nx/react-native:upgrade` instead.
|
|
4
|
-
* TODO (@xiongemi): remove this generator for nx v19
|
|
5
|
-
* This function is a destructive command that replace React Native iOS and Android code with latest.
|
|
6
|
-
* It would replace the Android and iOS folder entirely.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.reactNativeUpgradeNativeGenerator = reactNativeUpgradeNativeGenerator;
|
|
10
|
-
const devkit_1 = require("@nx/devkit");
|
|
11
|
-
const fs_1 = require("fs");
|
|
12
|
-
const pod_install_task_1 = require("../../utils/pod-install-task");
|
|
13
|
-
const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
|
|
14
|
-
const create_native_files_1 = require("./lib/create-native-files");
|
|
15
|
-
async function reactNativeUpgradeNativeGenerator(host, schema) {
|
|
16
|
-
devkit_1.logger.warn(`Please run 'nx run @nx/react-native:upgrade ${schema.name}' instead.`);
|
|
17
|
-
const { projectType, root: appProjectRoot } = (0, devkit_1.readProjectConfiguration)(host, schema.name);
|
|
18
|
-
const iosProjectRoot = (0, devkit_1.joinPathFragments)(host.root, appProjectRoot, 'ios');
|
|
19
|
-
const androidProjectRoot = (0, devkit_1.joinPathFragments)(host.root, appProjectRoot, 'android');
|
|
20
|
-
if (projectType !== 'application' ||
|
|
21
|
-
!(0, fs_1.existsSync)(iosProjectRoot) ||
|
|
22
|
-
!(0, fs_1.existsSync)(androidProjectRoot)) {
|
|
23
|
-
throw new Error(`Could not upgrade React Native code for ${schema.name}`);
|
|
24
|
-
}
|
|
25
|
-
(0, create_native_files_1.createNativeFiles)(host, schema, appProjectRoot);
|
|
26
|
-
const podInstallTask = (0, pod_install_task_1.runPodInstall)(iosProjectRoot, schema.install);
|
|
27
|
-
const chmodTaskGradlew = (0, chmod_android_gradle_files_1.chmodAndroidGradlewFilesTask)(androidProjectRoot);
|
|
28
|
-
return (0, devkit_1.runTasksInSerial)(podInstallTask, chmodTaskGradlew);
|
|
29
|
-
}
|
|
30
|
-
exports.default = reactNativeUpgradeNativeGenerator;
|