@nrwl/react-native 13.10.0-beta.6 → 13.10.0-beta.9
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/executors.json +6 -6
- package/generators.json +14 -14
- package/migrations.json +29 -0
- package/package.json +9 -9
- package/plugins/metro-resolver.js +3 -3
- package/plugins/metro-resolver.js.map +1 -1
- package/plugins/with-nx-metro.js +1 -1
- package/plugins/with-nx-metro.js.map +1 -1
- package/src/executors/build-android/schema.json +3 -3
- package/src/executors/bundle/schema.json +2 -2
- package/src/executors/run-android/schema.json +14 -8
- package/src/executors/run-ios/schema.json +20 -6
- package/src/executors/start/schema.json +1 -1
- package/src/executors/storybook/schema.json +2 -2
- package/src/executors/sync-deps/schema.json +2 -2
- package/src/generators/application/schema.json +7 -6
- package/src/generators/component/schema.json +8 -7
- package/src/generators/component-story/schema.json +3 -1
- package/src/generators/init/init.js +7 -1
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/init/init.spec.ts +26 -0
- package/src/generators/init/schema.json +4 -3
- package/src/generators/library/schema.json +9 -8
- package/src/generators/stories/schema.json +3 -1
- package/src/generators/storybook-configuration/schema.json +4 -2
- package/src/utils/versions.d.ts +6 -5
- package/src/utils/versions.js +11 -7
- package/src/utils/versions.js.map +1 -1
package/executors.json
CHANGED
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"sync-deps": {
|
|
29
29
|
"implementation": "./src/executors/sync-deps/sync-deps.impl",
|
|
30
30
|
"schema": "./src/executors/sync-deps/schema.json",
|
|
31
|
-
"description": "Syncs dependencies to package.json (required for autolinking)."
|
|
31
|
+
"description": "Syncs dependencies to `package.json` (required for autolinking)."
|
|
32
32
|
},
|
|
33
33
|
"ensure-symlink": {
|
|
34
34
|
"implementation": "./src/executors/ensure-symlink/ensure-symlink.impl",
|
|
35
35
|
"schema": "./src/executors/ensure-symlink//schema.json",
|
|
36
|
-
"description": "Ensure workspace node_modules is symlink under app's node_modules folder."
|
|
36
|
+
"description": "Ensure workspace `node_modules` is symlink under app's `node_modules` folder."
|
|
37
37
|
},
|
|
38
38
|
"storybook": {
|
|
39
39
|
"implementation": "./src/executors/storybook/storybook.impl",
|
|
40
40
|
"schema": "./src/executors/storybook/schema.json",
|
|
41
|
-
"description": "Serve React Native Storybook"
|
|
41
|
+
"description": "Serve React Native Storybook."
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"builders": {
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
"sync-deps": {
|
|
71
71
|
"implementation": "./src/executors/sync-deps/compat",
|
|
72
72
|
"schema": "./src/executors/sync-deps/schema.json",
|
|
73
|
-
"description": "Syncs dependencies to package.json (required for autolinking)."
|
|
73
|
+
"description": "Syncs dependencies to `package.json` (required for autolinking)."
|
|
74
74
|
},
|
|
75
75
|
"ensure-symlink": {
|
|
76
76
|
"implementation": "./src/executors/ensure-symlink/compat",
|
|
77
77
|
"schema": "./src/executors/ensure-symlink//schema.json",
|
|
78
|
-
"description": "Ensure workspace node_modules is symlink under app's node_modules folder."
|
|
78
|
+
"description": "Ensure workspace `node_modules` is symlink under app's `node_modules` folder."
|
|
79
79
|
},
|
|
80
80
|
"storybook": {
|
|
81
81
|
"implementation": "./src/executors/storybook/compat",
|
|
82
82
|
"schema": "./src/executors/storybook/schema.json",
|
|
83
|
-
"description": "Serve React Native Storybook"
|
|
83
|
+
"description": "Serve React Native Storybook."
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
package/generators.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"init": {
|
|
7
7
|
"factory": "./src/generators/init/init#reactNativeInitSchematic",
|
|
8
8
|
"schema": "./src/generators/init/schema.json",
|
|
9
|
-
"description": "Initialize the
|
|
9
|
+
"description": "Initialize the `@nrwl/react-native` plugin.",
|
|
10
10
|
"hidden": true
|
|
11
11
|
},
|
|
12
12
|
"application": {
|
|
@@ -14,37 +14,37 @@
|
|
|
14
14
|
"schema": "./src/generators/application/schema.json",
|
|
15
15
|
"aliases": ["app"],
|
|
16
16
|
"x-type": "application",
|
|
17
|
-
"description": "Create a React Native application"
|
|
17
|
+
"description": "Create a React Native application."
|
|
18
18
|
},
|
|
19
19
|
"library": {
|
|
20
20
|
"factory": "./src/generators/library/library#reactNativeLibrarySchematic",
|
|
21
21
|
"schema": "./src/generators/library/schema.json",
|
|
22
22
|
"aliases": ["lib"],
|
|
23
23
|
"x-type": "library",
|
|
24
|
-
"description": "Create a React Native library"
|
|
24
|
+
"description": "Create a React Native library."
|
|
25
25
|
},
|
|
26
26
|
"component": {
|
|
27
27
|
"factory": "./src/generators/component/component#reactNativeComponentSchematic",
|
|
28
28
|
"schema": "./src/generators/component/schema.json",
|
|
29
|
-
"description": "Create a React Native component",
|
|
29
|
+
"description": "Create a React Native component.",
|
|
30
30
|
"aliases": ["c"]
|
|
31
31
|
},
|
|
32
32
|
"storybook-configuration": {
|
|
33
33
|
"factory": "./src/generators/storybook-configuration/configuration#storybookConfigurationSchematic",
|
|
34
34
|
"schema": "./src/generators/storybook-configuration/schema.json",
|
|
35
|
-
"description": "Set up
|
|
35
|
+
"description": "Set up Storybook for a React-native application or library.",
|
|
36
36
|
"hidden": false
|
|
37
37
|
},
|
|
38
38
|
"component-story": {
|
|
39
39
|
"factory": "./src/generators/component-story/component-story#componentStorySchematic",
|
|
40
40
|
"schema": "./src/generators/component-story/schema.json",
|
|
41
|
-
"description": "Generate
|
|
41
|
+
"description": "Generate Storybook story for a React-native component.",
|
|
42
42
|
"hidden": false
|
|
43
43
|
},
|
|
44
44
|
"stories": {
|
|
45
45
|
"factory": "./src/generators/stories/stories#storiesSchematic",
|
|
46
46
|
"schema": "./src/generators/stories/schema.json",
|
|
47
|
-
"description": "Create stories for all components declared in an
|
|
47
|
+
"description": "Create stories for all components declared in an application or library.",
|
|
48
48
|
"hidden": false
|
|
49
49
|
}
|
|
50
50
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"init": {
|
|
53
53
|
"factory": "./src/generators/init/init#reactNativeInitGenerator",
|
|
54
54
|
"schema": "./src/generators/init/schema.json",
|
|
55
|
-
"description": "Initialize the
|
|
55
|
+
"description": "Initialize the `@nrwl/react-native` plugin.",
|
|
56
56
|
"hidden": true
|
|
57
57
|
},
|
|
58
58
|
"application": {
|
|
@@ -60,37 +60,37 @@
|
|
|
60
60
|
"schema": "./src/generators/application/schema.json",
|
|
61
61
|
"aliases": ["app"],
|
|
62
62
|
"x-type": "application",
|
|
63
|
-
"description": "Create a React Native application"
|
|
63
|
+
"description": "Create a React Native application."
|
|
64
64
|
},
|
|
65
65
|
"library": {
|
|
66
66
|
"factory": "./src/generators/library/library#reactNativeLibraryGenerator",
|
|
67
67
|
"schema": "./src/generators/library/schema.json",
|
|
68
68
|
"aliases": ["lib"],
|
|
69
69
|
"x-type": "library",
|
|
70
|
-
"description": "Create a React Native library"
|
|
70
|
+
"description": "Create a React Native library."
|
|
71
71
|
},
|
|
72
72
|
"component": {
|
|
73
73
|
"factory": "./src/generators/component/component#reactNativeComponentGenerator",
|
|
74
74
|
"schema": "./src/generators/component/schema.json",
|
|
75
|
-
"description": "Create a React Native component",
|
|
75
|
+
"description": "Create a React Native component.",
|
|
76
76
|
"aliases": ["c"]
|
|
77
77
|
},
|
|
78
78
|
"storybook-configuration": {
|
|
79
79
|
"factory": "./src/generators/storybook-configuration/configuration#storybookConfigurationGenerator",
|
|
80
80
|
"schema": "./src/generators/storybook-configuration/schema.json",
|
|
81
|
-
"description": "Set up
|
|
81
|
+
"description": "Set up Storybook for a React-native application or library.",
|
|
82
82
|
"hidden": false
|
|
83
83
|
},
|
|
84
84
|
"component-story": {
|
|
85
85
|
"factory": "./src/generators/component-story/component-story#componentStoryGenerator",
|
|
86
86
|
"schema": "./src/generators/component-story/schema.json",
|
|
87
|
-
"description": "Generate
|
|
87
|
+
"description": "Generate Storybook story for a React-native component.",
|
|
88
88
|
"hidden": false
|
|
89
89
|
},
|
|
90
90
|
"stories": {
|
|
91
91
|
"factory": "./src/generators/stories/stories#storiesGenerator",
|
|
92
92
|
"schema": "./src/generators/stories/schema.json",
|
|
93
|
-
"description": "Create stories/specs for all components declared in an
|
|
93
|
+
"description": "Create stories/specs for all components declared in an application or library.",
|
|
94
94
|
"hidden": false
|
|
95
95
|
}
|
|
96
96
|
}
|
package/migrations.json
CHANGED
|
@@ -440,6 +440,35 @@
|
|
|
440
440
|
"alwaysAddToPackageJson": false
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
+
},
|
|
444
|
+
"13.10.0": {
|
|
445
|
+
"version": "13.10.0-beta.1",
|
|
446
|
+
"packages": {
|
|
447
|
+
"react-native": {
|
|
448
|
+
"version": "0.67.4",
|
|
449
|
+
"alwaysAddToPackageJson": false
|
|
450
|
+
},
|
|
451
|
+
"metro": {
|
|
452
|
+
"version": "0.70.0",
|
|
453
|
+
"alwaysAddToPackageJson": false
|
|
454
|
+
},
|
|
455
|
+
"@types/react": {
|
|
456
|
+
"version": "17.0.43",
|
|
457
|
+
"alwaysAddToPackageJson": false
|
|
458
|
+
},
|
|
459
|
+
"metro-react-native-babel-preset": {
|
|
460
|
+
"version": "0.70.0",
|
|
461
|
+
"alwaysAddToPackageJson": false
|
|
462
|
+
},
|
|
463
|
+
"@testing-library/react-native": {
|
|
464
|
+
"version": "9.1.0",
|
|
465
|
+
"alwaysAddToPackageJson": false
|
|
466
|
+
},
|
|
467
|
+
"@babel/runtime": {
|
|
468
|
+
"version": "7.17.8",
|
|
469
|
+
"alwaysAddToPackageJson": false
|
|
470
|
+
}
|
|
471
|
+
}
|
|
443
472
|
}
|
|
444
473
|
}
|
|
445
474
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react-native",
|
|
3
|
-
"version": "13.10.0-beta.
|
|
4
|
-
"description": "React Native Plugin for Nx",
|
|
3
|
+
"version": "13.10.0-beta.9",
|
|
4
|
+
"description": "React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.\n\nThe Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Detox, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Monorepo",
|
|
7
7
|
"React",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"types": "index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nrwl/detox": "13.10.0-beta.
|
|
28
|
-
"@nrwl/devkit": "13.10.0-beta.
|
|
29
|
-
"@nrwl/jest": "13.10.0-beta.
|
|
30
|
-
"@nrwl/linter": "13.10.0-beta.
|
|
31
|
-
"@nrwl/storybook": "13.10.0-beta.
|
|
32
|
-
"@nrwl/react": "13.10.0-beta.
|
|
33
|
-
"@nrwl/workspace": "13.10.0-beta.
|
|
27
|
+
"@nrwl/detox": "13.10.0-beta.9",
|
|
28
|
+
"@nrwl/devkit": "13.10.0-beta.9",
|
|
29
|
+
"@nrwl/jest": "13.10.0-beta.9",
|
|
30
|
+
"@nrwl/linter": "13.10.0-beta.9",
|
|
31
|
+
"@nrwl/storybook": "13.10.0-beta.9",
|
|
32
|
+
"@nrwl/react": "13.10.0-beta.9",
|
|
33
|
+
"@nrwl/workspace": "13.10.0-beta.9",
|
|
34
34
|
"chalk": "^4.1.0",
|
|
35
35
|
"enhanced-resolve": "^5.8.3",
|
|
36
36
|
"fs-extra": "^9.1.0",
|
|
@@ -55,7 +55,7 @@ function defaultMetroResolver(context, moduleName, platform) {
|
|
|
55
55
|
function pnpmResolver(extensions, context, realModuleName, moduleName) {
|
|
56
56
|
const DEBUG = process.env.NX_REACT_NATIVE_DEBUG === 'true';
|
|
57
57
|
try {
|
|
58
|
-
const pnpmResolver = getPnpmResolver(devkit_1.
|
|
58
|
+
const pnpmResolver = getPnpmResolver(devkit_1.workspaceRoot, extensions);
|
|
59
59
|
const lookupStartPath = (0, path_1.dirname)(context.originModulePath);
|
|
60
60
|
const filePath = pnpmResolver.resolveSync({}, lookupStartPath, realModuleName);
|
|
61
61
|
if (filePath) {
|
|
@@ -114,14 +114,14 @@ function getMatcher() {
|
|
|
114
114
|
* It is inspired form https://github.com/vjpr/pnpm-expo-example/blob/main/packages/pnpm-expo-helper/util/make-resolver.js.
|
|
115
115
|
*/
|
|
116
116
|
let resolver;
|
|
117
|
-
function getPnpmResolver(
|
|
117
|
+
function getPnpmResolver(workspaceRoot, extensions) {
|
|
118
118
|
if (!resolver) {
|
|
119
119
|
const fileSystem = new enhanced_resolve_1.CachedInputFileSystem(fs, 4000);
|
|
120
120
|
resolver = enhanced_resolve_1.ResolverFactory.createResolver({
|
|
121
121
|
fileSystem,
|
|
122
122
|
extensions: extensions.map((extension) => '.' + extension),
|
|
123
123
|
useSyncFileSystemCalls: true,
|
|
124
|
-
modules: [(0, path_1.join)(
|
|
124
|
+
modules: [(0, path_1.join)(workspaceRoot, 'node_modules'), 'node_modules'],
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
return resolver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro-resolver.js","sourceRoot":"","sources":["../../../../packages/react-native/plugins/metro-resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAEhD,mDAA6D;AAC7D,+BAA+B;AAC/B,uDAA0E;AAC1E,+BAAqC;AACrC,yBAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"metro-resolver.js","sourceRoot":"","sources":["../../../../packages/react-native/plugins/metro-resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAEhD,mDAA6D;AAC7D,+BAA+B;AAC/B,uDAA0E;AAC1E,+BAAqC;AACrC,yBAAyB;AACzB,yCAA6C;AAE7C;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,UAAoB;IACpD,OAAO,UACL,QAAa,EACb,cAAsB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AAC,QAAQ,EAAE;QACb,MAAM,UAAU,GAAG,IAAI,wCAAqB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACvD,QAAQ,GAAG,kCAAe,CAAC,cAAc,CAAC;YACxC,UAAU;YACV,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,GAAG,SAAS,CAAC;YAC1D,sBAAsB,EAAE,IAAI;YAC5B,OAAO,EAAE,CAAC,IAAA,WAAI,EAAC,aAAa,EAAE,cAAc,CAAC,EAAE,cAAc,CAAC;SAC/D,CAAC,CAAC;KACJ;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/plugins/with-nx-metro.js
CHANGED
|
@@ -10,7 +10,7 @@ function withNxMetro(config, opts = {}) {
|
|
|
10
10
|
if (opts.extensions)
|
|
11
11
|
extensions.push(...opts.extensions);
|
|
12
12
|
// Set the root to workspace root so we can resolve modules and assets
|
|
13
|
-
config.projectRoot = app_root_1.
|
|
13
|
+
config.projectRoot = app_root_1.workspaceRoot;
|
|
14
14
|
// Add support for paths specified by tsconfig
|
|
15
15
|
config.resolver = Object.assign(Object.assign({}, config.resolver), { resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions) });
|
|
16
16
|
return config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-nx-metro.js","sourceRoot":"","sources":["../../../../packages/react-native/plugins/with-nx-metro.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"with-nx-metro.js","sourceRoot":"","sources":["../../../../packages/react-native/plugins/with-nx-metro.ts"],"names":[],"mappings":";;;AAAA,iEAAmE;AACnE,qDAAqD;AAOrD,SAAgB,WAAW,CAAC,MAAW,EAAE,OAAsB,EAAE;IAC/D,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC1D,IAAI,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,MAAM,CAAC;IAC3D,IAAI,IAAI,CAAC,UAAU;QAAE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAEzD,sEAAsE;IACtE,MAAM,CAAC,WAAW,GAAG,wBAAa,CAAC;IAEnC,8CAA8C;IAC9C,MAAM,CAAC,QAAQ,mCACV,MAAM,CAAC,QAAQ,KAClB,cAAc,EAAE,IAAA,kCAAiB,EAAC,UAAU,CAAC,GAC9C,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAfD,kCAeC"}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
"$id": "NxReactNativeBuildAndroid",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Release Build for Android",
|
|
6
|
-
"description": "Build target options",
|
|
6
|
+
"description": "Build target options for Android.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"apk": {
|
|
10
10
|
"type": "boolean",
|
|
11
|
-
"description": "Generate apk file(s) rather than a bundle (
|
|
11
|
+
"description": "Generate apk file(s) rather than a bundle (`.aab`)."
|
|
12
12
|
},
|
|
13
13
|
"debug": {
|
|
14
14
|
"type": "boolean",
|
|
15
|
-
"description": "Generate a debug build instead of a release build"
|
|
15
|
+
"description": "Generate a debug build instead of a release build."
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"required": []
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "NxReactNativeBundle",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Offline JS Bundle for React Native",
|
|
6
|
-
"description": "JS Bundle target options",
|
|
6
|
+
"description": "JS Bundle target options.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"dev": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"description": "Whether source maps should be generated or not."
|
|
29
29
|
},
|
|
30
30
|
"platform": {
|
|
31
|
-
"description": "Platform to build for (ios
|
|
31
|
+
"description": "Platform to build for (`ios`, `android`).",
|
|
32
32
|
"type": "string"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
@@ -3,22 +3,28 @@
|
|
|
3
3
|
"$id": "NxReactNativeRunAndroid",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Run Android application",
|
|
6
|
-
"description": "Run Android target options",
|
|
6
|
+
"description": "Run Android target options.",
|
|
7
7
|
"type": "object",
|
|
8
|
+
"presets": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Run Android without cache",
|
|
11
|
+
"keys": ["variant", "sync", "port", "packager", "resetCache"]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
8
14
|
"properties": {
|
|
9
15
|
"variant": {
|
|
10
16
|
"type": "string",
|
|
11
|
-
"description": "Specify your app's build variant (e.g. debug
|
|
17
|
+
"description": "Specify your app's build variant (e.g. `debug`, `release`).",
|
|
12
18
|
"default": "debug",
|
|
13
19
|
"examples": ["debug", "release"]
|
|
14
20
|
},
|
|
15
21
|
"appId": {
|
|
16
22
|
"type": "string",
|
|
17
|
-
"description": "Specify an applicationId to launch after build. If not specified,
|
|
23
|
+
"description": "Specify an `applicationId` to launch after build. If not specified, `package` from `AndroidManifest.xml` will be used."
|
|
18
24
|
},
|
|
19
25
|
"appIdSuffix": {
|
|
20
26
|
"type": "string",
|
|
21
|
-
"description": "Specify an applicationIdSuffix to launch after build."
|
|
27
|
+
"description": "Specify an `applicationIdSuffix` to launch after build."
|
|
22
28
|
},
|
|
23
29
|
"mainActivity": {
|
|
24
30
|
"type": "string",
|
|
@@ -27,20 +33,20 @@
|
|
|
27
33
|
},
|
|
28
34
|
"deviceId": {
|
|
29
35
|
"type": "string",
|
|
30
|
-
"description": "Builds your app and starts it on a specific device/simulator with the given device id (listed by running
|
|
36
|
+
"description": "Builds your app and starts it on a specific device/simulator with the given device id (listed by running `adb devices` on the command line)."
|
|
31
37
|
},
|
|
32
38
|
"tasks": {
|
|
33
39
|
"type": "string",
|
|
34
|
-
"description": "Run custom
|
|
40
|
+
"description": "Run custom Gradle tasks. If this argument is provided, then `--variant` option is ignored. Example: `yarn react-native run-android --tasks clean,installDebug`."
|
|
35
41
|
},
|
|
36
42
|
"jetifier": {
|
|
37
43
|
"type": "boolean",
|
|
38
|
-
"description": "Run
|
|
44
|
+
"description": "Run Jetifier – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet.",
|
|
39
45
|
"default": true
|
|
40
46
|
},
|
|
41
47
|
"sync": {
|
|
42
48
|
"type": "boolean",
|
|
43
|
-
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
|
|
49
|
+
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
|
|
44
50
|
"default": true
|
|
45
51
|
},
|
|
46
52
|
"port": {
|
|
@@ -3,22 +3,36 @@
|
|
|
3
3
|
"$id": "NxReactNativeRunIos",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Run iOS application",
|
|
6
|
-
"description": "Run iOS target options",
|
|
6
|
+
"description": "Run iOS target options.",
|
|
7
7
|
"type": "object",
|
|
8
|
+
"presets": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Run iOS without cache",
|
|
11
|
+
"keys": [
|
|
12
|
+
"xcodeConfiguration",
|
|
13
|
+
"install",
|
|
14
|
+
"sync",
|
|
15
|
+
"port",
|
|
16
|
+
"packager",
|
|
17
|
+
"resetCache"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
8
21
|
"properties": {
|
|
9
22
|
"xcodeConfiguration": {
|
|
10
23
|
"type": "string",
|
|
11
|
-
"description": "Explicitly set the Xcode configuration to use",
|
|
24
|
+
"description": "Explicitly set the Xcode configuration to use.",
|
|
12
25
|
"default": "Debug",
|
|
13
26
|
"examples": ["Debug", "Release"]
|
|
14
27
|
},
|
|
15
28
|
"scheme": {
|
|
16
29
|
"type": "string",
|
|
17
|
-
"description": "Explicitly set the Xcode scheme to use"
|
|
30
|
+
"description": "Explicitly set the Xcode scheme to use."
|
|
18
31
|
},
|
|
19
32
|
"simulator": {
|
|
20
33
|
"type": "string",
|
|
21
|
-
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version:
|
|
34
|
+
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: `iPhone X (12.1)`.",
|
|
35
|
+
"default": "iPhone X",
|
|
22
36
|
"examples": ["iPhone X"]
|
|
23
37
|
},
|
|
24
38
|
"device": {
|
|
@@ -27,12 +41,12 @@
|
|
|
27
41
|
},
|
|
28
42
|
"install": {
|
|
29
43
|
"type": "boolean",
|
|
30
|
-
"description": "Runs
|
|
44
|
+
"description": "Runs `pod install` for native modules before building iOS app.",
|
|
31
45
|
"default": true
|
|
32
46
|
},
|
|
33
47
|
"sync": {
|
|
34
48
|
"type": "boolean",
|
|
35
|
-
"description": "Syncs npm dependencies to package.json (for React Native autolink). Always true when
|
|
49
|
+
"description": "Syncs npm dependencies to `package.json` (for React Native autolink). Always true when `--install` is used.",
|
|
36
50
|
"default": true
|
|
37
51
|
},
|
|
38
52
|
"port": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "NxReactNativeStart",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Packager Server for React Native",
|
|
6
|
-
"description": "Packager Server target options",
|
|
6
|
+
"description": "Packager Server target options.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"port": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "React Native Storybook Load Stories",
|
|
3
3
|
"cli": "nx",
|
|
4
|
-
"description": "Load stories for react native",
|
|
4
|
+
"description": "Load stories for react native.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"searchDir": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"pattern": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with
|
|
18
|
+
"description": "The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with `**/*...` must be escaped with quotes",
|
|
19
19
|
"default": "**/*.stories.@(js|jsx|ts|tsx|md)"
|
|
20
20
|
},
|
|
21
21
|
"silent": {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"$id": "NxReactNativeSyncDeps",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Sync Deps for React Native",
|
|
6
|
-
"description": "Updates package.json with project dependencies",
|
|
6
|
+
"description": "Updates `package.json` with project dependencies.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"include": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"description": "A comma-separated list of additional npm packages to include. e.g.
|
|
11
|
+
"description": "A comma-separated list of additional npm packages to include. e.g. `nx sync-deps --include=react-native-gesture-handler,react-native-safe-area-context`"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
"$id": "NxReactNativeApplication",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Create a React Application for Nx",
|
|
6
|
+
"description": "Create a React Application for Nx.",
|
|
6
7
|
"examples": [
|
|
7
8
|
{
|
|
8
|
-
"command": "g app myapp --directory=nested",
|
|
9
|
-
"description": "Generate apps/nested/myapp"
|
|
9
|
+
"command": "nx g app myapp --directory=nested",
|
|
10
|
+
"description": "Generate `apps/nested/myapp`"
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
|
-
"command": "g app myapp --classComponent",
|
|
13
|
+
"command": "nx g app myapp --classComponent",
|
|
13
14
|
"description": "Use class components instead of functional components"
|
|
14
15
|
}
|
|
15
16
|
],
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
},
|
|
53
54
|
"tags": {
|
|
54
55
|
"type": "string",
|
|
55
|
-
"description": "Add tags to the application (used for linting)",
|
|
56
|
+
"description": "Add tags to the application (used for linting).",
|
|
56
57
|
"alias": "t"
|
|
57
58
|
},
|
|
58
59
|
"js": {
|
|
@@ -62,11 +63,11 @@
|
|
|
62
63
|
},
|
|
63
64
|
"setParserOptionsProject": {
|
|
64
65
|
"type": "boolean",
|
|
65
|
-
"description": "Whether or not to configure the ESLint
|
|
66
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
66
67
|
"default": false
|
|
67
68
|
},
|
|
68
69
|
"e2eTestRunner": {
|
|
69
|
-
"description": "Adds the specified e2e test runner",
|
|
70
|
+
"description": "Adds the specified e2e test runner.",
|
|
70
71
|
"type": "string",
|
|
71
72
|
"enum": ["detox", "none"],
|
|
72
73
|
"default": "detox"
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
"$id": "NxReactNativeApplication",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Create a React Native Component for Nx",
|
|
6
|
+
"description": "Create a React native Component for Nx.",
|
|
6
7
|
"type": "object",
|
|
7
8
|
"examples": [
|
|
8
9
|
{
|
|
9
|
-
"command": "g component my-component --project=mylib",
|
|
10
|
-
"description": "Generate a component in the mylib library"
|
|
10
|
+
"command": "nx g component my-component --project=mylib",
|
|
11
|
+
"description": "Generate a component in the `mylib` library"
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
|
-
"command": "g component my-component --project=mylib --classComponent",
|
|
14
|
-
"description": "Generate a class component in the mylib library"
|
|
14
|
+
"command": "nx g component my-component --project=mylib --classComponent",
|
|
15
|
+
"description": "Generate a class component in the `mylib` library"
|
|
15
16
|
}
|
|
16
17
|
],
|
|
17
18
|
"properties": {
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
},
|
|
41
42
|
"skipTests": {
|
|
42
43
|
"type": "boolean",
|
|
43
|
-
"description": "When true, does not create
|
|
44
|
+
"description": "When true, does not create `spec.ts` test files for the new component.",
|
|
44
45
|
"default": false
|
|
45
46
|
},
|
|
46
47
|
"directory": {
|
|
@@ -55,14 +56,14 @@
|
|
|
55
56
|
},
|
|
56
57
|
"export": {
|
|
57
58
|
"type": "boolean",
|
|
58
|
-
"description": "When true, the component is exported from the project index.ts (if it exists).",
|
|
59
|
+
"description": "When true, the component is exported from the project `index.ts` (if it exists).",
|
|
59
60
|
"alias": "e",
|
|
60
61
|
"default": false,
|
|
61
62
|
"x-prompt": "Should this component be exported in the project?"
|
|
62
63
|
},
|
|
63
64
|
"pascalCaseFiles": {
|
|
64
65
|
"type": "boolean",
|
|
65
|
-
"description": "Use pascal case component file name (e.g. App.tsx).",
|
|
66
|
+
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
66
67
|
"alias": "P",
|
|
67
68
|
"default": false
|
|
68
69
|
},
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"cli": "nx",
|
|
4
4
|
"$id": "NxReactNativeComponentStory",
|
|
5
|
+
"title": "React native component story",
|
|
6
|
+
"description": "Generate storybook story for a react-native component.",
|
|
5
7
|
"type": "object",
|
|
6
8
|
"properties": {
|
|
7
9
|
"project": {
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
},
|
|
17
19
|
"componentPath": {
|
|
18
20
|
"type": "string",
|
|
19
|
-
"description": "Relative path to the component file from the library root",
|
|
21
|
+
"description": "Relative path to the component file from the library root.",
|
|
20
22
|
"examples": ["lib/components"],
|
|
21
23
|
"x-prompt": "What's path of the component relative to the project's lib root?"
|
|
22
24
|
}
|
|
@@ -33,9 +33,15 @@ function reactNativeInitGenerator(host, schema) {
|
|
|
33
33
|
}
|
|
34
34
|
exports.reactNativeInitGenerator = reactNativeInitGenerator;
|
|
35
35
|
function updateDependencies(host) {
|
|
36
|
+
var _a;
|
|
36
37
|
const isPnpm = (0, devkit_1.detectPackageManager)(host.root) === 'pnpm';
|
|
38
|
+
const { dependencies = {} } = (0, devkit_1.readJson)(host, 'package.json');
|
|
39
|
+
// TODO(jack): Remove this once React Native 0.68.0 is out.
|
|
40
|
+
if ((_a = dependencies['react']) === null || _a === void 0 ? void 0 : _a.match(/[\^~]?18/)) {
|
|
41
|
+
devkit_1.logger.warn(`React version ${dependencies['react']} is incompatible with React Native version ${versions_2.reactNativeVersion}. Nx will downgrade the version to ${versions_2.reactVersion}.`);
|
|
42
|
+
}
|
|
37
43
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
38
|
-
react:
|
|
44
|
+
react: versions_2.reactVersion,
|
|
39
45
|
'react-native': versions_2.reactNativeVersion,
|
|
40
46
|
}, Object.assign({ '@nrwl/react-native': versions_2.nxVersion, '@types/react': versions_1.typesReactVersion, '@types/react-native': versions_2.typesReactNativeVersion, '@react-native-community/cli': versions_2.reactNativeCommunityCli, '@react-native-community/cli-platform-android': versions_2.reactNativeCommunityCliAndroid, '@react-native-community/cli-platform-ios': versions_2.reactNativeCommunityCliIos, 'metro-react-native-babel-preset': versions_2.metroReactNativeBabelPresetVersion, '@testing-library/react-native': versions_2.testingLibraryReactNativeVersion, '@testing-library/jest-native': versions_2.testingLibraryJestNativeVersion, 'jest-react-native': versions_2.jestReactNativeVersion, metro: versions_2.metroVersion, 'metro-resolver': versions_2.metroVersion, 'react-test-renderer': versions_2.reactTestRendererVersion, 'react-native-svg-transformer': versions_2.reactNativeSvgTransformerVersion, 'react-native-svg': versions_2.reactNativeSvgVersion, 'react-native-config': versions_2.reactNativeConfigVersion, '@react-native-async-storage/async-storage': versions_2.reactNativeAsyncStorageAsyncStorageVersion }, (isPnpm
|
|
41
47
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,iGAA4F;AAC5F,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AAC7E,CAAC;AAED,kBAAe,wBAAwB,CAAC;AAC3B,QAAA,wBAAwB,GAAG,IAAA,2BAAkB,EACxD,wBAAwB,CACzB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { logger } from '@nrwl/devkit';
|
|
1
2
|
import { Tree, readJson, updateJson } from '@nrwl/devkit';
|
|
2
3
|
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
4
|
import { reactNativeInitGenerator } from './init';
|
|
@@ -34,6 +35,31 @@ describe('init', () => {
|
|
|
34
35
|
expect(content).toMatch(/# Nested node_modules/);
|
|
35
36
|
});
|
|
36
37
|
|
|
38
|
+
it.each`
|
|
39
|
+
version
|
|
40
|
+
${'18.0.0'}
|
|
41
|
+
${'~18.0.0'}
|
|
42
|
+
${'^18.0.0'}
|
|
43
|
+
`(
|
|
44
|
+
'should warn if React v18 is already installed in workspace',
|
|
45
|
+
async ({ version }) => {
|
|
46
|
+
const spy = jest.spyOn(logger, 'warn');
|
|
47
|
+
spy.mockImplementation(() => {});
|
|
48
|
+
updateJson(tree, 'package.json', (json) => {
|
|
49
|
+
json.dependencies = {
|
|
50
|
+
react: version,
|
|
51
|
+
};
|
|
52
|
+
return json;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
await reactNativeInitGenerator(tree, { e2eTestRunner: 'none' });
|
|
56
|
+
|
|
57
|
+
expect(spy).toHaveBeenCalledWith(expect.stringContaining('incompatible'));
|
|
58
|
+
|
|
59
|
+
spy.mockRestore();
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
37
63
|
describe('defaultCollection', () => {
|
|
38
64
|
it('should be set if none was set before', async () => {
|
|
39
65
|
await reactNativeInitGenerator(tree, { e2eTestRunner: 'none' });
|
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
"$id": "NxReactNativeInit",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Add Nx React Native Schematics",
|
|
6
|
+
"description": "Add Nx React native schematics.",
|
|
6
7
|
"type": "object",
|
|
7
8
|
"properties": {
|
|
8
9
|
"unitTestRunner": {
|
|
9
|
-
"description": "Adds the specified unit test runner",
|
|
10
|
+
"description": "Adds the specified unit test runner.",
|
|
10
11
|
"type": "string",
|
|
11
12
|
"enum": ["jest", "none"],
|
|
12
13
|
"default": "jest"
|
|
13
14
|
},
|
|
14
15
|
"skipFormat": {
|
|
15
|
-
"description": "Skip formatting files",
|
|
16
|
+
"description": "Skip formatting files.",
|
|
16
17
|
"type": "boolean",
|
|
17
18
|
"default": false
|
|
18
19
|
},
|
|
19
20
|
"e2eTestRunner": {
|
|
20
|
-
"description": "Adds the specified
|
|
21
|
+
"description": "Adds the specified E2E test runner.",
|
|
21
22
|
"type": "string",
|
|
22
23
|
"enum": ["detox", "none"],
|
|
23
24
|
"default": "detox"
|
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
"$id": "NxReactNativeLibrary",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
5
|
"title": "Create a React Native Library for Nx",
|
|
6
|
+
"description": "Create a React Native Library for Nx.",
|
|
6
7
|
"type": "object",
|
|
7
8
|
"examples": [
|
|
8
9
|
{
|
|
9
|
-
"command": "g lib mylib --directory=myapp",
|
|
10
|
-
"description": "Generate libs/myapp/mylib"
|
|
10
|
+
"command": "nx g lib mylib --directory=myapp",
|
|
11
|
+
"description": "Generate `libs/myapp/mylib`"
|
|
11
12
|
}
|
|
12
13
|
],
|
|
13
14
|
"properties": {
|
|
14
15
|
"name": {
|
|
15
16
|
"type": "string",
|
|
16
|
-
"description": "Library name",
|
|
17
|
+
"description": "Library name.",
|
|
17
18
|
"$default": {
|
|
18
19
|
"$source": "argv",
|
|
19
20
|
"index": 0
|
|
@@ -51,11 +52,11 @@
|
|
|
51
52
|
"skipTsConfig": {
|
|
52
53
|
"type": "boolean",
|
|
53
54
|
"default": false,
|
|
54
|
-
"description": "Do not update tsconfig.json for development experience."
|
|
55
|
+
"description": "Do not update `tsconfig.json` for development experience."
|
|
55
56
|
},
|
|
56
57
|
"pascalCaseFiles": {
|
|
57
58
|
"type": "boolean",
|
|
58
|
-
"description": "Use pascal case component file name (e.g. App.tsx).",
|
|
59
|
+
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
59
60
|
"alias": "P",
|
|
60
61
|
"default": false
|
|
61
62
|
},
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
},
|
|
71
72
|
"importPath": {
|
|
72
73
|
"type": "string",
|
|
73
|
-
"description": "The library name used to import it, like
|
|
74
|
+
"description": "The library name used to import it, like `@myorg/my-awesome-lib`."
|
|
74
75
|
},
|
|
75
76
|
"js": {
|
|
76
77
|
"type": "boolean",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
},
|
|
80
81
|
"globalCss": {
|
|
81
82
|
"type": "boolean",
|
|
82
|
-
"description": "When true
|
|
83
|
+
"description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).",
|
|
83
84
|
"default": false
|
|
84
85
|
},
|
|
85
86
|
"strict": {
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
},
|
|
90
91
|
"setParserOptionsProject": {
|
|
91
92
|
"type": "boolean",
|
|
92
|
-
"description": "Whether or not to configure the ESLint
|
|
93
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
93
94
|
"default": false
|
|
94
95
|
}
|
|
95
96
|
},
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"cli": "nx",
|
|
4
4
|
"$id": "NxReactNativeStorybookStories",
|
|
5
|
+
"title": "React native Storybook stories",
|
|
6
|
+
"description": "React native Storybook stories.",
|
|
5
7
|
"type": "object",
|
|
6
8
|
"properties": {
|
|
7
9
|
"project": {
|
|
8
10
|
"type": "string",
|
|
9
|
-
"description": "Library or application name",
|
|
11
|
+
"description": "Library or application name.",
|
|
10
12
|
"$default": {
|
|
11
13
|
"$source": "projectName",
|
|
12
14
|
"index": 0
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"cli": "nx",
|
|
4
4
|
"$id": "NxReactNativeStorybookConfigure",
|
|
5
|
+
"title": "React native Storybook configuration",
|
|
6
|
+
"description": "Set up Storybook for a React-Native app or library",
|
|
5
7
|
"type": "object",
|
|
6
8
|
"properties": {
|
|
7
9
|
"name": {
|
|
8
10
|
"type": "string",
|
|
9
|
-
"description": "Project name",
|
|
11
|
+
"description": "Project name.",
|
|
10
12
|
"$default": {
|
|
11
13
|
"$source": "argv",
|
|
12
14
|
"index": 0
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"default": "eslint"
|
|
31
33
|
},
|
|
32
34
|
"standaloneConfig": {
|
|
33
|
-
"description": "Split the project configuration into
|
|
35
|
+
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
34
36
|
"type": "boolean"
|
|
35
37
|
}
|
|
36
38
|
},
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export declare const nxVersion = "*";
|
|
2
|
-
export declare const reactNativeVersion = "0.67.
|
|
2
|
+
export declare const reactNativeVersion = "0.67.4";
|
|
3
3
|
export declare const typesReactNativeVersion = "0.67.3";
|
|
4
|
-
export declare const metroVersion = "0.
|
|
4
|
+
export declare const metroVersion = "0.70.0";
|
|
5
|
+
export declare const reactVersion = "17.0.2";
|
|
5
6
|
export declare const reactNativeCommunityCli = "7.0.1";
|
|
6
7
|
export declare const reactNativeCommunityCliIos = "7.0.1";
|
|
7
8
|
export declare const reactNativeCommunityCliAndroid = "7.0.1";
|
|
8
9
|
export declare const reactNativeConfigVersion = "1.4.5";
|
|
9
10
|
export declare const reactNativeAsyncStorageAsyncStorageVersion = "1.16.3";
|
|
10
|
-
export declare const metroReactNativeBabelPresetVersion = "0.
|
|
11
|
-
export declare const testingLibraryReactNativeVersion = "9.
|
|
11
|
+
export declare const metroReactNativeBabelPresetVersion = "0.70.0";
|
|
12
|
+
export declare const testingLibraryReactNativeVersion = "9.1.0";
|
|
12
13
|
export declare const testingLibraryJestNativeVersion = "4.0.4";
|
|
13
14
|
export declare const jestReactNativeVersion = "18.0.0";
|
|
14
15
|
export declare const reactTestRendererVersion = "17.0.2";
|
|
15
16
|
export declare const reactNativeSvgTransformerVersion = "1.0.0";
|
|
16
17
|
export declare const reactNativeSvgVersion = "12.3.0";
|
|
17
|
-
export declare const babelRuntimeVersion = "7.17.
|
|
18
|
+
export declare const babelRuntimeVersion = "7.17.8";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.metroReactNativeBabelPresetVersion = exports.reactNativeAsyncStorageAsyncStorageVersion = exports.reactNativeConfigVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.metroVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '13.10.0-beta.
|
|
5
|
-
exports.reactNativeVersion = '0.67.
|
|
3
|
+
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.metroReactNativeBabelPresetVersion = exports.reactNativeAsyncStorageAsyncStorageVersion = exports.reactNativeConfigVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.reactVersion = exports.metroVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
|
+
exports.nxVersion = '13.10.0-beta.9';
|
|
5
|
+
exports.reactNativeVersion = '0.67.4';
|
|
6
6
|
exports.typesReactNativeVersion = '0.67.3';
|
|
7
|
-
exports.metroVersion = '0.
|
|
7
|
+
exports.metroVersion = '0.70.0';
|
|
8
|
+
// TODO(jack): Remove this once react-native 0.68.0 is released.
|
|
9
|
+
// v18 is only supported on the New Architecture
|
|
10
|
+
// See: https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout
|
|
11
|
+
exports.reactVersion = '17.0.2';
|
|
8
12
|
exports.reactNativeCommunityCli = '7.0.1';
|
|
9
13
|
exports.reactNativeCommunityCliIos = '7.0.1';
|
|
10
14
|
exports.reactNativeCommunityCliAndroid = '7.0.1';
|
|
11
15
|
exports.reactNativeConfigVersion = '1.4.5';
|
|
12
16
|
exports.reactNativeAsyncStorageAsyncStorageVersion = '1.16.3';
|
|
13
|
-
exports.metroReactNativeBabelPresetVersion = '0.
|
|
14
|
-
exports.testingLibraryReactNativeVersion = '9.
|
|
17
|
+
exports.metroReactNativeBabelPresetVersion = '0.70.0';
|
|
18
|
+
exports.testingLibraryReactNativeVersion = '9.1.0';
|
|
15
19
|
exports.testingLibraryJestNativeVersion = '4.0.4';
|
|
16
20
|
exports.jestReactNativeVersion = '18.0.0';
|
|
17
21
|
exports.reactTestRendererVersion = '17.0.2';
|
|
18
22
|
exports.reactNativeSvgTransformerVersion = '1.0.0';
|
|
19
23
|
exports.reactNativeSvgVersion = '12.3.0';
|
|
20
|
-
exports.babelRuntimeVersion = '7.17.
|
|
24
|
+
exports.babelRuntimeVersion = '7.17.8';
|
|
21
25
|
//# sourceMappingURL=versions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG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