@nx/react-native 17.0.3 → 17.0.5
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 +7 -1
- package/LICENSE +1 -1
- package/README.md +9 -4
- package/executors.json +5 -0
- package/generators.json +12 -11
- package/migrations.json +126 -0
- package/package.json +11 -15
- package/plugin.d.ts +1 -0
- package/plugin.js +6 -0
- package/plugins/metro-resolver.js +4 -1
- package/plugins/plugin.d.ts +14 -0
- package/plugins/plugin.js +162 -0
- package/plugins/with-nx-metro.js +6 -2
- package/src/executors/build-android/build-android.impl.js +2 -6
- package/src/executors/build-android/build-android.impl.ts +2 -6
- package/src/executors/build-android/schema.json +1 -1
- package/src/executors/build-ios/schema.json +1 -1
- package/src/executors/bundle/schema.d.ts +1 -1
- package/src/executors/bundle/schema.json +1 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +4 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +4 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.ts +4 -0
- package/src/executors/ensure-symlink/schema.json +1 -1
- package/src/executors/pod-install/schema.json +1 -1
- package/src/executors/run-android/run-android.impl.js +5 -17
- package/src/executors/run-android/run-android.impl.ts +9 -18
- package/src/executors/run-android/schema.json +1 -1
- package/src/executors/run-ios/run-ios.impl.js +4 -16
- package/src/executors/run-ios/run-ios.impl.ts +9 -18
- package/src/executors/run-ios/schema.json +1 -1
- package/src/executors/start/schema.d.ts +1 -1
- package/src/executors/start/schema.json +1 -1
- package/src/executors/start/start.impl.js +11 -26
- package/src/executors/start/start.impl.ts +14 -28
- package/src/executors/storybook/storybook.impl.d.ts +4 -0
- package/src/executors/storybook/storybook.impl.js +15 -2
- package/src/executors/storybook/storybook.impl.ts +26 -7
- package/src/executors/sync-deps/schema.d.ts +1 -0
- package/src/executors/sync-deps/schema.json +6 -1
- package/src/executors/sync-deps/sync-deps.impl.d.ts +2 -1
- package/src/executors/sync-deps/sync-deps.impl.js +33 -11
- package/src/executors/sync-deps/sync-deps.impl.ts +57 -18
- package/src/executors/upgrade/schema.d.ts +1 -0
- package/src/executors/upgrade/schema.json +11 -0
- package/src/executors/upgrade/upgrade.impl.d.ts +13 -0
- package/src/executors/upgrade/upgrade.impl.js +47 -0
- package/src/executors/upgrade/upgrade.impl.ts +64 -0
- package/src/generators/application/application.js +52 -8
- package/src/generators/application/application.spec.ts +29 -2
- package/src/generators/application/files/app/.babelrc.js.template +23 -0
- package/src/generators/application/files/app/Gemfile.template +2 -1
- package/src/generators/application/files/app/android/app/build.gradle.template +12 -28
- package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +2 -6
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.kt.template +22 -0
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.kt.template +45 -0
- package/src/generators/application/files/app/android/build.gradle.template +7 -20
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +2 -1
- package/src/generators/application/files/app/android/gradle.properties +0 -3
- package/src/generators/application/files/app/android/gradlew.template +12 -7
- package/src/generators/application/files/app/android/settings.gradle.template +2 -2
- package/src/generators/application/files/app/ios/Podfile.template +0 -7
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +5 -0
- package/src/generators/application/files/app/ios/__className__/Info.plist.template +5 -8
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +11 -33
- package/src/generators/application/files/app/metro.config.js.template +1 -5
- package/src/generators/application/files/app/src/app/App.tsx.template +50 -13
- package/src/generators/application/lib/add-e2e.d.ts +3 -0
- package/src/generators/application/lib/add-e2e.js +46 -0
- package/src/generators/application/lib/add-project.js +18 -18
- package/src/generators/application/lib/normalize-options.d.ts +7 -0
- package/src/generators/application/lib/normalize-options.js +35 -3
- package/src/generators/application/lib/normalize-options.spec.ts +70 -7
- package/src/generators/application/schema.d.ts +5 -3
- package/src/generators/application/schema.json +14 -6
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +1 -1
- package/src/generators/component/schema.d.ts +3 -3
- package/src/generators/component/schema.json +4 -4
- package/src/generators/component-story/component-story.d.ts +5 -8
- package/src/generators/component-story/component-story.js +8 -69
- package/src/generators/component-story/schema.d.ts +1 -0
- package/src/generators/component-story/schema.json +11 -3
- package/src/generators/init/init.d.ts +2 -1
- package/src/generators/init/init.js +55 -56
- package/src/generators/init/init.spec.ts +7 -6
- package/src/generators/init/schema.d.ts +3 -3
- package/src/generators/init/schema.json +13 -18
- package/src/generators/library/files/lib/.babelrc.js.template +21 -0
- package/src/generators/library/lib/normalize-options.js +5 -0
- package/src/generators/library/library.js +48 -38
- package/src/generators/library/library.spec.ts +12 -60
- package/src/generators/library/schema.d.ts +1 -0
- package/src/generators/library/schema.json +2 -2
- package/src/generators/stories/schema.d.ts +2 -0
- package/src/generators/stories/schema.json +15 -2
- package/src/generators/stories/stories.d.ts +5 -2
- package/src/generators/stories/stories.js +7 -50
- package/src/generators/storybook-configuration/configuration.d.ts +7 -2
- package/src/generators/storybook-configuration/configuration.js +18 -48
- package/src/generators/storybook-configuration/schema.d.ts +4 -2
- package/src/generators/storybook-configuration/schema.json +22 -12
- package/src/generators/upgrade-native/lib/normalize-options.d.ts +1 -1
- package/src/generators/upgrade-native/schema.d.ts +1 -1
- package/src/generators/upgrade-native/schema.json +3 -3
- package/src/generators/upgrade-native/upgrade-native.d.ts +2 -0
- package/src/generators/upgrade-native/upgrade-native.js +3 -0
- package/src/generators/web-configuration/files/base-vite/.babelrc.js.template +23 -0
- package/src/generators/web-configuration/files/base-vite/index.html__tmpl__ +15 -0
- package/src/generators/web-configuration/files/base-vite/public/favicon.ico +0 -0
- package/src/generators/web-configuration/files/base-vite/src/assets/.gitkeep +0 -0
- package/src/generators/web-configuration/files/base-vite/src/main-web.tsx__tmpl__ +9 -0
- package/src/generators/web-configuration/files/base-vite/vite.config.ts__tmpl__ +82 -0
- package/src/generators/web-configuration/files/base-webpack/.babelrc.js.template +23 -0
- package/src/generators/web-configuration/files/base-webpack/src/assets/.gitkeep +0 -0
- package/src/generators/web-configuration/files/base-webpack/src/favicon.ico +0 -0
- package/src/generators/web-configuration/files/base-webpack/src/index.html__tmpl__ +14 -0
- package/src/generators/web-configuration/files/base-webpack/src/main-web.tsx__tmpl__ +9 -0
- package/src/generators/web-configuration/files/base-webpack/webpack.config.js__tmpl__ +77 -0
- package/src/generators/web-configuration/lib/normalize-schema.d.ts +17 -0
- package/src/generators/web-configuration/lib/normalize-schema.js +16 -0
- package/src/generators/web-configuration/lib/webpack-targets.d.ts +7 -0
- package/src/generators/web-configuration/lib/webpack-targets.js +75 -0
- package/src/generators/web-configuration/schema.d.ts +6 -0
- package/src/generators/web-configuration/schema.json +42 -0
- package/src/generators/web-configuration/web-configuration.d.ts +12 -0
- package/src/generators/web-configuration/web-configuration.js +87 -0
- package/src/migrations/update-16-6-0/update-metro-config.js +1 -5
- package/src/migrations/update-16-9-0/remove-types-react-native.js +2 -9
- package/src/migrations/update-18-0-0/add-upgrade-target.d.ts +6 -0
- package/src/migrations/update-18-0-0/add-upgrade-target.js +33 -0
- package/src/migrations/update-18-0-0/add-web-configuration.d.ts +8 -0
- package/src/migrations/update-18-0-0/add-web-configuration.js +33 -0
- package/src/migrations/update-18-0-0/add-web-configuration.spec.ts +39 -0
- package/src/migrations/update-18-0-0/change-storybook-targets.d.ts +5 -0
- package/src/migrations/update-18-0-0/change-storybook-targets.js +57 -0
- package/src/migrations/update-18-0-0/remove-block-list.d.ts +6 -0
- package/src/migrations/update-18-0-0/remove-block-list.js +28 -0
- package/src/migrations/update-18-0-0/remove-block-list.spec.ts +68 -0
- package/src/migrations/update-18-0-0/remove-metro.d.ts +14 -0
- package/src/migrations/update-18-0-0/remove-metro.js +29 -0
- package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +6 -0
- package/src/migrations/update-18-0-0/remove-symlink-target.js +30 -0
- package/src/migrations/update-18-0-0/remove-symlink-target.spec.ts +40 -0
- package/src/utils/add-jest.d.ts +1 -1
- package/src/utils/add-jest.js +13 -1
- package/src/utils/add-linting.d.ts +1 -0
- package/src/utils/add-linting.js +1 -1
- package/src/utils/add-linting.spec.ts +4 -6
- package/src/utils/chmod-android-gradle-files.js +6 -2
- package/src/utils/ensure-dependencies.d.ts +2 -0
- package/src/utils/ensure-dependencies.js +30 -0
- package/src/utils/find-all-npm-dependencies.js +5 -3
- package/src/utils/find-all-npm-dependencies.spec.ts +17 -9
- package/src/utils/testing-generators.js +1 -0
- package/src/utils/versions.d.ts +10 -13
- package/src/utils/versions.js +11 -14
- package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -75
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +0 -32
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +0 -62
- package/src/generators/application/files/app/android/app/src/release/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -20
- package/src/generators/application/files/app/babel.config.json.template +0 -3
- package/src/generators/application/lib/add-detox.d.ts +0 -3
- package/src/generators/application/lib/add-detox.js +0 -23
- package/src/generators/component-story/component-story.spec.ts +0 -428
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -32
- package/src/generators/library/files/lib/babel.config.json.template +0 -17
- package/src/generators/stories/stories-app.spec.ts +0 -128
- package/src/generators/stories/stories-lib.spec.ts +0 -105
- package/src/generators/storybook-configuration/configuration.spec.ts +0 -135
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +0 -9
- package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +0 -74
- package/src/generators/storybook-configuration/files/root/story-loader.ts.template +0 -5
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.d.ts +0 -6
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js +0 -25
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +0 -161
- package/src/generators/storybook-configuration/lib/create-storybook-files.d.ts +0 -6
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +0 -42
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.d.ts +0 -7
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +0 -29
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +0 -65
- package/src/utils/symlink-task.d.ts +0 -2
- package/src/utils/symlink-task.js +0 -18
package/src/utils/add-linting.js
CHANGED
|
@@ -14,9 +14,9 @@ async function addLinting(host, options) {
|
|
|
14
14
|
linter: options.linter,
|
|
15
15
|
project: options.projectName,
|
|
16
16
|
tsConfigPaths: options.tsConfigPaths,
|
|
17
|
-
eslintFilePatterns: [`${options.projectRoot}/**/*.{ts,tsx,js,jsx}`],
|
|
18
17
|
skipFormat: true,
|
|
19
18
|
skipPackageJson: options.skipPackageJson,
|
|
19
|
+
addPlugin: options.addPlugin,
|
|
20
20
|
});
|
|
21
21
|
tasks.push(lintTask);
|
|
22
22
|
if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
@@ -15,21 +15,19 @@ describe('Add Linting', () => {
|
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it('should add
|
|
19
|
-
addLinting(tree, {
|
|
18
|
+
it('should add a .eslintrc.json when is passed', async () => {
|
|
19
|
+
await addLinting(tree, {
|
|
20
20
|
projectName: 'my-lib',
|
|
21
21
|
linter: Linter.EsLint,
|
|
22
22
|
tsConfigPaths: ['libs/my-lib/tsconfig.lib.json'],
|
|
23
23
|
projectRoot: 'libs/my-lib',
|
|
24
24
|
});
|
|
25
|
-
const project = readProjectConfiguration(tree, 'my-lib');
|
|
26
25
|
|
|
27
|
-
expect(
|
|
28
|
-
expect(project.targets.lint.executor).toEqual('@nx/eslint:lint');
|
|
26
|
+
expect(tree.exists('libs/my-lib/.eslintrc.json')).toBeTruthy();
|
|
29
27
|
});
|
|
30
28
|
|
|
31
29
|
it('should not add lint target when "none" is passed', async () => {
|
|
32
|
-
addLinting(tree, {
|
|
30
|
+
await addLinting(tree, {
|
|
33
31
|
projectName: 'my-lib',
|
|
34
32
|
linter: Linter.None,
|
|
35
33
|
tsConfigPaths: ['libs/my-lib/tsconfig.lib.json'],
|
|
@@ -5,8 +5,12 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
function chmodAndroidGradlewFiles(androidFolder) {
|
|
8
|
-
(0, fs_1.
|
|
9
|
-
|
|
8
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(androidFolder, 'gradlew'))) {
|
|
9
|
+
(0, fs_1.chmodSync)((0, path_1.join)(androidFolder, 'gradlew'), 0o775);
|
|
10
|
+
}
|
|
11
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(androidFolder, 'gradlew.bat'))) {
|
|
12
|
+
(0, fs_1.chmodSync)((0, path_1.join)(androidFolder, 'gradlew.bat'), 0o775);
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
exports.chmodAndroidGradlewFiles = chmodAndroidGradlewFiles;
|
|
12
16
|
function chmodAndroidGradlewFilesTask(androidFolder) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ensureDependencies = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const versions_1 = require("@nx/react/src/utils/versions");
|
|
6
|
+
const versions_2 = require("./versions");
|
|
7
|
+
function ensureDependencies(tree) {
|
|
8
|
+
const isPnpm = (0, devkit_1.detectPackageManager)(tree.root) === 'pnpm';
|
|
9
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
10
|
+
'@types/node': versions_2.typesNodeVersion,
|
|
11
|
+
'@types/react': versions_2.typesReactVersion,
|
|
12
|
+
'@react-native/babel-preset': versions_2.reactNativeBabelPresetVersion,
|
|
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
|
+
'@react-native-community/cli-platform-android': versions_2.reactNativeCommunityCliPlatformAndroidVersion,
|
|
17
|
+
'jest-react-native': versions_2.jestReactNativeVersion,
|
|
18
|
+
'react-test-renderer': versions_2.reactTestRendererVersion,
|
|
19
|
+
'react-native-svg-transformer': versions_2.reactNativeSvgTransformerVersion,
|
|
20
|
+
'react-native-svg': versions_2.reactNativeSvgVersion,
|
|
21
|
+
'@babel/preset-react': versions_1.babelPresetReactVersion,
|
|
22
|
+
'@babel/core': versions_1.babelCoreVersion,
|
|
23
|
+
...(isPnpm
|
|
24
|
+
? {
|
|
25
|
+
'@babel/runtime': versions_2.babelRuntimeVersion, // @babel/runtime is used by react-native-svg
|
|
26
|
+
}
|
|
27
|
+
: {}),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.ensureDependencies = ensureDependencies;
|
|
@@ -8,11 +8,13 @@ function findAllNpmDependencies(graph, projectName, list = [], seen = new Set())
|
|
|
8
8
|
}
|
|
9
9
|
seen.add(projectName);
|
|
10
10
|
const node = graph.externalNodes[projectName];
|
|
11
|
-
// Don't want to include '@nx/react-native' because React Native
|
|
11
|
+
// Don't want to include '@nx/react-native' and '@nx/expo' because React Native
|
|
12
12
|
// autolink will warn that the package has no podspec file for iOS.
|
|
13
13
|
if (node) {
|
|
14
|
-
if (node.name !==
|
|
15
|
-
node.name !==
|
|
14
|
+
if (node.name !== `npm:@nx/react-native` &&
|
|
15
|
+
node.name !== `npm:@nrwl/react-native` &&
|
|
16
|
+
node.name !== `npm:@nx/expo` &&
|
|
17
|
+
node.name !== `npm:@nrwl/expo`) {
|
|
16
18
|
list.push(node.data.packageName);
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findAllNpmDependencies } from './find-all-npm-dependencies';
|
|
2
|
-
import { ProjectGraph } from '@nx/devkit';
|
|
2
|
+
import { DependencyType, ProjectGraph } from '@nx/devkit';
|
|
3
3
|
|
|
4
4
|
test('findAllNpmDependencies', () => {
|
|
5
5
|
const graph: ProjectGraph = {
|
|
@@ -61,26 +61,34 @@ test('findAllNpmDependencies', () => {
|
|
|
61
61
|
},
|
|
62
62
|
dependencies: {
|
|
63
63
|
myapp: [
|
|
64
|
-
{ type:
|
|
65
|
-
{ type:
|
|
64
|
+
{ type: DependencyType.static, source: 'myapp', target: 'lib1' },
|
|
65
|
+
{ type: DependencyType.static, source: 'myapp', target: 'lib2' },
|
|
66
66
|
{
|
|
67
|
-
type:
|
|
67
|
+
type: DependencyType.static,
|
|
68
68
|
source: 'myapp',
|
|
69
69
|
target: 'npm:react-native-image-picker',
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
type:
|
|
72
|
+
type: DependencyType.static,
|
|
73
73
|
source: 'myapp',
|
|
74
74
|
target: 'npm:@nx/react-native',
|
|
75
75
|
},
|
|
76
76
|
],
|
|
77
77
|
lib1: [
|
|
78
|
-
{ type:
|
|
79
|
-
{
|
|
78
|
+
{ type: DependencyType.static, source: 'lib1', target: 'lib2' },
|
|
79
|
+
{
|
|
80
|
+
type: DependencyType.static,
|
|
81
|
+
source: 'lib3',
|
|
82
|
+
target: 'npm:react-native-snackbar',
|
|
83
|
+
},
|
|
80
84
|
],
|
|
81
|
-
lib2: [{ type:
|
|
85
|
+
lib2: [{ type: DependencyType.static, source: 'lib2', target: 'lib3' }],
|
|
82
86
|
lib3: [
|
|
83
|
-
{
|
|
87
|
+
{
|
|
88
|
+
type: DependencyType.static,
|
|
89
|
+
source: 'lib3',
|
|
90
|
+
target: 'npm:react-native-dialog',
|
|
91
|
+
},
|
|
84
92
|
],
|
|
85
93
|
},
|
|
86
94
|
};
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const reactNativeVersion = "0.
|
|
3
|
-
export declare const typesNodeVersion = "18.
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const reactNativeCommunityCliAndroid = "11.3.6";
|
|
2
|
+
export declare const reactNativeVersion = "0.73.2";
|
|
3
|
+
export declare const typesNodeVersion = "18.16.9";
|
|
4
|
+
export declare const reactNativeCommunityCliPlatformAndroidVersion = "12.3.0";
|
|
5
|
+
export declare const reactNativeBabelPresetVersion = "^0.73.18";
|
|
6
|
+
export declare const reactNativeMetroConfigVersion = "^0.73.2";
|
|
7
|
+
export declare const reactNativeWebVersion = "^0.19.9";
|
|
9
8
|
export declare const reactVersion = "18.2.0";
|
|
10
9
|
export declare const reactDomVersion = "18.2.0";
|
|
11
10
|
export declare const reactTestRendererVersion = "18.2.0";
|
|
12
|
-
export declare const typesReactVersion = "18.
|
|
13
|
-
export declare const testingLibraryReactNativeVersion = "~12.
|
|
11
|
+
export declare const typesReactVersion = "~18.2.45";
|
|
12
|
+
export declare const testingLibraryReactNativeVersion = "~12.4.2";
|
|
14
13
|
export declare const testingLibraryJestNativeVersion = "~5.4.3";
|
|
15
14
|
export declare const jestReactNativeVersion = "18.0.0";
|
|
16
|
-
export declare const reactNativeSvgTransformerVersion = "1.
|
|
17
|
-
export declare const reactNativeSvgVersion = "
|
|
15
|
+
export declare const reactNativeSvgTransformerVersion = "1.2.0";
|
|
16
|
+
export declare const reactNativeSvgVersion = "14.1.0";
|
|
18
17
|
export declare const babelRuntimeVersion = "7.22.6";
|
|
19
|
-
export declare const reactNativeAsyncStorageVersion = "~1.19.3";
|
|
20
|
-
export declare const reactNativeSafeAreaContextVersion = "~4.7.2";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.typesNodeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.reactNativeVersion = '0.
|
|
6
|
-
exports.typesNodeVersion = '18.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.reactNativeCommunityCliAndroid = '11.3.6';
|
|
5
|
+
exports.reactNativeVersion = '0.73.2';
|
|
6
|
+
exports.typesNodeVersion = '18.16.9';
|
|
7
|
+
exports.reactNativeCommunityCliPlatformAndroidVersion = '12.3.0'; // anddroid refers files from this package
|
|
8
|
+
exports.reactNativeBabelPresetVersion = '^0.73.18';
|
|
9
|
+
exports.reactNativeMetroConfigVersion = '^0.73.2';
|
|
10
|
+
exports.reactNativeWebVersion = '^0.19.9';
|
|
12
11
|
exports.reactVersion = '18.2.0';
|
|
13
12
|
exports.reactDomVersion = '18.2.0';
|
|
14
13
|
exports.reactTestRendererVersion = '18.2.0';
|
|
15
|
-
exports.typesReactVersion = '18.
|
|
16
|
-
exports.testingLibraryReactNativeVersion = '~12.
|
|
14
|
+
exports.typesReactVersion = '~18.2.45';
|
|
15
|
+
exports.testingLibraryReactNativeVersion = '~12.4.2';
|
|
17
16
|
exports.testingLibraryJestNativeVersion = '~5.4.3';
|
|
18
17
|
exports.jestReactNativeVersion = '18.0.0';
|
|
19
|
-
exports.reactNativeSvgTransformerVersion = '1.
|
|
20
|
-
exports.reactNativeSvgVersion = '
|
|
18
|
+
exports.reactNativeSvgTransformerVersion = '1.2.0';
|
|
19
|
+
exports.reactNativeSvgVersion = '14.1.0';
|
|
21
20
|
exports.babelRuntimeVersion = '7.22.6';
|
|
22
|
-
exports.reactNativeAsyncStorageVersion = '~1.19.3';
|
|
23
|
-
exports.reactNativeSafeAreaContextVersion = '~4.7.2';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
-
* directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
package com.<%= lowerCaseName %>;
|
|
8
|
-
|
|
9
|
-
import android.content.Context;
|
|
10
|
-
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
-
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
-
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
-
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
-
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
-
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
-
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
-
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
-
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
21
|
-
import com.facebook.react.ReactInstanceEventListener;
|
|
22
|
-
import com.facebook.react.ReactInstanceManager;
|
|
23
|
-
import com.facebook.react.bridge.ReactContext;
|
|
24
|
-
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
-
import okhttp3.OkHttpClient;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Class responsible of loading Flipper inside your React Native application. This is the debug
|
|
29
|
-
* flavor of it. Here you can add your own plugins and customize the Flipper setup.
|
|
30
|
-
*/
|
|
31
|
-
public class ReactNativeFlipper {
|
|
32
|
-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
33
|
-
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
34
|
-
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
35
|
-
|
|
36
|
-
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
37
|
-
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
38
|
-
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
39
|
-
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
40
|
-
|
|
41
|
-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
42
|
-
NetworkingModule.setCustomClientBuilder(
|
|
43
|
-
new NetworkingModule.CustomClientBuilder() {
|
|
44
|
-
@Override
|
|
45
|
-
public void apply(OkHttpClient.Builder builder) {
|
|
46
|
-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
client.addPlugin(networkFlipperPlugin);
|
|
50
|
-
client.start();
|
|
51
|
-
|
|
52
|
-
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
53
|
-
// Hence we run if after all native modules have been initialized
|
|
54
|
-
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
55
|
-
if (reactContext == null) {
|
|
56
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
57
|
-
new ReactInstanceEventListener() {
|
|
58
|
-
@Override
|
|
59
|
-
public void onReactContextInitialized(ReactContext reactContext) {
|
|
60
|
-
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
61
|
-
reactContext.runOnNativeModulesQueueThread(
|
|
62
|
-
new Runnable() {
|
|
63
|
-
@Override
|
|
64
|
-
public void run() {
|
|
65
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
} else {
|
|
71
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
package com.<%= lowerCaseName %>;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactActivity;
|
|
4
|
-
import com.facebook.react.ReactActivityDelegate;
|
|
5
|
-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
6
|
-
import com.facebook.react.defaults.DefaultReactActivityDelegate;
|
|
7
|
-
|
|
8
|
-
public class MainActivity extends ReactActivity {
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
12
|
-
* rendering of the component.
|
|
13
|
-
*/
|
|
14
|
-
@Override
|
|
15
|
-
protected String getMainComponentName() {
|
|
16
|
-
return "<%= className %>";
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
|
|
21
|
-
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
|
|
22
|
-
* (aka React 18) with two boolean flags.
|
|
23
|
-
*/
|
|
24
|
-
@Override
|
|
25
|
-
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
26
|
-
return new DefaultReactActivityDelegate(
|
|
27
|
-
this,
|
|
28
|
-
getMainComponentName(),
|
|
29
|
-
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
30
|
-
DefaultNewArchitectureEntryPoint.getFabricEnabled());
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
package com.<%= lowerCaseName %>;
|
|
2
|
-
|
|
3
|
-
import android.app.Application;
|
|
4
|
-
import com.facebook.react.PackageList;
|
|
5
|
-
import com.facebook.react.ReactApplication;
|
|
6
|
-
import com.facebook.react.ReactNativeHost;
|
|
7
|
-
import com.facebook.react.ReactPackage;
|
|
8
|
-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
9
|
-
import com.facebook.react.defaults.DefaultReactNativeHost;
|
|
10
|
-
import com.facebook.soloader.SoLoader;
|
|
11
|
-
import java.util.List;
|
|
12
|
-
|
|
13
|
-
public class MainApplication extends Application implements ReactApplication {
|
|
14
|
-
|
|
15
|
-
private final ReactNativeHost mReactNativeHost =
|
|
16
|
-
new DefaultReactNativeHost(this) {
|
|
17
|
-
@Override
|
|
18
|
-
public boolean getUseDeveloperSupport() {
|
|
19
|
-
return BuildConfig.DEBUG;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Override
|
|
23
|
-
protected List<ReactPackage> getPackages() {
|
|
24
|
-
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
25
|
-
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
26
|
-
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
27
|
-
// packages.add(new MyReactNativePackage());
|
|
28
|
-
return packages;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@Override
|
|
32
|
-
protected String getJSMainModuleName() {
|
|
33
|
-
return "<%= entryFile %>";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@Override
|
|
37
|
-
protected boolean isNewArchEnabled() {
|
|
38
|
-
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@Override
|
|
42
|
-
protected Boolean isHermesEnabled() {
|
|
43
|
-
return BuildConfig.IS_HERMES_ENABLED;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
@Override
|
|
48
|
-
public ReactNativeHost getReactNativeHost() {
|
|
49
|
-
return mReactNativeHost;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@Override
|
|
53
|
-
public void onCreate() {
|
|
54
|
-
super.onCreate();
|
|
55
|
-
SoLoader.init(this, /* native exopackage */ false);
|
|
56
|
-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
57
|
-
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
58
|
-
DefaultNewArchitectureEntryPoint.load();
|
|
59
|
-
}
|
|
60
|
-
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
-
* directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
package com.<%= lowerCaseName %>;
|
|
8
|
-
|
|
9
|
-
import android.content.Context;
|
|
10
|
-
import com.facebook.react.ReactInstanceManager;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Class responsible of loading Flipper inside your React Native application. This is the release
|
|
14
|
-
* flavor of it so it's empty as we don't want to load Flipper.
|
|
15
|
-
*/
|
|
16
|
-
public class ReactNativeFlipper {
|
|
17
|
-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
18
|
-
// Do nothing as we don't want to initialize Flipper on Release.
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDetox = void 0;
|
|
4
|
-
const detox_1 = require("@nx/detox");
|
|
5
|
-
const eslint_1 = require("@nx/eslint");
|
|
6
|
-
async function addDetox(host, options) {
|
|
7
|
-
if (options?.e2eTestRunner !== 'detox') {
|
|
8
|
-
return () => { };
|
|
9
|
-
}
|
|
10
|
-
return (0, detox_1.detoxApplicationGenerator)(host, {
|
|
11
|
-
...options,
|
|
12
|
-
linter: eslint_1.Linter.EsLint,
|
|
13
|
-
e2eName: `${options.projectName}-e2e`,
|
|
14
|
-
e2eDirectory: `${options.appProjectRoot}-e2e`,
|
|
15
|
-
projectNameAndRootFormat: 'as-provided',
|
|
16
|
-
appProject: options.projectName,
|
|
17
|
-
appDisplayName: options.displayName,
|
|
18
|
-
appName: options.name,
|
|
19
|
-
framework: 'react-native',
|
|
20
|
-
skipFormat: true,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.addDetox = addDetox;
|