@nrwl/react-native 14.5.0-beta.3 → 14.5.0-rc.0
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/CHANGELOG.md +1 -1
- package/migrations.json +33 -0
- package/package.json +9 -9
- package/src/generators/application/files/app/ios/Podfile.template +7 -9
- package/src/generators/application/files/app/metro.config.js.template +1 -2
- package/src/generators/storybook-configuration/configuration.js +3 -0
- package/src/generators/storybook-configuration/configuration.js.map +1 -1
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.d.ts +6 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js +26 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js.map +1 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +161 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +2 -2
- package/src/utils/versions.d.ts +7 -7
- package/src/utils/versions.js +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [14.5.0-
|
|
6
|
+
# [14.5.0-rc.0](https://github.com/nrwl/nx/compare/14.4.2...14.5.0-rc.0) (2022-07-28)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/react-native
|
package/migrations.json
CHANGED
|
@@ -765,6 +765,39 @@
|
|
|
765
765
|
"alwaysAddToPackageJson": false
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
|
+
},
|
|
769
|
+
"14.5.0": {
|
|
770
|
+
"version": "14.5.0-beta.0",
|
|
771
|
+
"packages": {
|
|
772
|
+
"react-native": {
|
|
773
|
+
"version": "0.69.3",
|
|
774
|
+
"alwaysAddToPackageJson": false
|
|
775
|
+
},
|
|
776
|
+
"@testing-library/react-native": {
|
|
777
|
+
"version": "11.0.0",
|
|
778
|
+
"alwaysAddToPackageJson": false
|
|
779
|
+
},
|
|
780
|
+
"react-native-svg": {
|
|
781
|
+
"version": "12.4.3",
|
|
782
|
+
"alwaysAddToPackageJson": false
|
|
783
|
+
},
|
|
784
|
+
"@babel/runtime": {
|
|
785
|
+
"version": "7.18.9",
|
|
786
|
+
"alwaysAddToPackageJson": false
|
|
787
|
+
},
|
|
788
|
+
"@react-native-community/cli": {
|
|
789
|
+
"version": "8.0.4",
|
|
790
|
+
"alwaysAddToPackageJson": false
|
|
791
|
+
},
|
|
792
|
+
"@react-native-community/cli-platform-android": {
|
|
793
|
+
"version": "8.0.4",
|
|
794
|
+
"alwaysAddToPackageJson": false
|
|
795
|
+
},
|
|
796
|
+
"@react-native-community/cli-platform-ios": {
|
|
797
|
+
"version": "8.0.4",
|
|
798
|
+
"alwaysAddToPackageJson": false
|
|
799
|
+
}
|
|
800
|
+
}
|
|
768
801
|
}
|
|
769
802
|
}
|
|
770
803
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react-native",
|
|
3
|
-
"version": "14.5.0-
|
|
3
|
+
"version": "14.5.0-rc.0",
|
|
4
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",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"types": "index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nrwl/detox": "14.5.0-
|
|
28
|
-
"@nrwl/devkit": "14.5.0-
|
|
29
|
-
"@nrwl/jest": "14.5.0-
|
|
30
|
-
"@nrwl/linter": "14.5.0-
|
|
31
|
-
"@nrwl/react": "14.5.0-
|
|
32
|
-
"@nrwl/storybook": "14.5.0-
|
|
33
|
-
"@nrwl/workspace": "14.5.0-
|
|
27
|
+
"@nrwl/detox": "14.5.0-rc.0",
|
|
28
|
+
"@nrwl/devkit": "14.5.0-rc.0",
|
|
29
|
+
"@nrwl/jest": "14.5.0-rc.0",
|
|
30
|
+
"@nrwl/linter": "14.5.0-rc.0",
|
|
31
|
+
"@nrwl/react": "14.5.0-rc.0",
|
|
32
|
+
"@nrwl/storybook": "14.5.0-rc.0",
|
|
33
|
+
"@nrwl/workspace": "14.5.0-rc.0",
|
|
34
34
|
"chalk": "^4.1.0",
|
|
35
35
|
"enhanced-resolve": "^5.8.3",
|
|
36
36
|
"fs-extra": "^10.1.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
},
|
|
50
50
|
"schematics": "./generators.json",
|
|
51
51
|
"typings": "./index.d.ts",
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "635825ed2b08bcd001a36eeb26ef992336f466ed"
|
|
53
53
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
require_relative '
|
|
2
|
-
require_relative '
|
|
3
|
-
require_relative '
|
|
1
|
+
require_relative '<%= offsetFromRoot %>../node_modules/react-native/scripts/react_native_pods'
|
|
2
|
+
require_relative '<%= offsetFromRoot %>../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
|
3
|
+
require_relative '<%= offsetFromRoot %>../node_modules/@nrwl/react-native/nx_post_install'
|
|
4
4
|
|
|
5
5
|
platform :ios, '12.4'
|
|
6
6
|
install! 'cocoapods', :deterministic_uuids => false
|
|
7
7
|
|
|
8
|
+
production = ENV["PRODUCTION"] == "1"
|
|
9
|
+
|
|
8
10
|
target '<%= className %>' do
|
|
9
11
|
config = use_native_modules!
|
|
10
12
|
|
|
@@ -14,8 +16,10 @@ target '<%= className %>' do
|
|
|
14
16
|
use_react_native!(
|
|
15
17
|
:path => config[:reactNativePath],
|
|
16
18
|
# to enable hermes on iOS, change `false` to `true` and then install pods
|
|
19
|
+
:production => production,
|
|
17
20
|
:hermes_enabled => flags[:hermes_enabled],
|
|
18
21
|
:fabric_enabled => flags[:fabric_enabled],
|
|
22
|
+
:flipper_configuration => FlipperConfiguration.enabled,
|
|
19
23
|
# An absolute path to your application root.
|
|
20
24
|
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
21
25
|
)
|
|
@@ -25,12 +29,6 @@ target '<%= className %>' do
|
|
|
25
29
|
# Pods for testing
|
|
26
30
|
end
|
|
27
31
|
|
|
28
|
-
# Enables Flipper.
|
|
29
|
-
#
|
|
30
|
-
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
31
|
-
# you should disable the next line.
|
|
32
|
-
use_flipper!()
|
|
33
|
-
|
|
34
32
|
post_install do |installer|
|
|
35
33
|
react_native_post_install(installer)
|
|
36
34
|
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
@@ -20,8 +20,7 @@ module.exports = (async () => {
|
|
|
20
20
|
resolver: {
|
|
21
21
|
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
22
22
|
sourceExts: [...sourceExts, 'svg'],
|
|
23
|
-
|
|
24
|
-
blockList: exclusionList([/\.\/dist\/.*/]),
|
|
23
|
+
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
|
25
24
|
},
|
|
26
25
|
},
|
|
27
26
|
{
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
6
|
const storybook_1 = require("@nrwl/storybook");
|
|
7
7
|
const stories_1 = require("../stories/stories");
|
|
8
|
+
const add_resolver_main_fields_to_metro_config_1 = require("./lib/add-resolver-main-fields-to-metro-config");
|
|
8
9
|
const create_storybook_files_1 = require("./lib/create-storybook-files");
|
|
9
10
|
const replace_app_import_with_storybook_toggle_1 = require("./lib/replace-app-import-with-storybook-toggle");
|
|
10
11
|
function generateStories(host, schema) {
|
|
@@ -28,9 +29,11 @@ function storybookConfigurationGenerator(host, schema) {
|
|
|
28
29
|
addStorybookTask(host, schema.name);
|
|
29
30
|
(0, create_storybook_files_1.createStorybookFiles)(host, schema);
|
|
30
31
|
(0, replace_app_import_with_storybook_toggle_1.replaceAppImportWithStorybookToggle)(host, schema);
|
|
32
|
+
(0, add_resolver_main_fields_to_metro_config_1.addResolverMainFieldsToMetroConfig)(host, schema);
|
|
31
33
|
if (schema.generateStories) {
|
|
32
34
|
yield generateStories(host, schema);
|
|
33
35
|
}
|
|
36
|
+
yield (0, devkit_1.formatFiles)(host);
|
|
34
37
|
return installTask;
|
|
35
38
|
});
|
|
36
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/storybook-configuration/configuration.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/storybook-configuration/configuration.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,+CAAyD;AAEzD,gDAAkD;AAClD,6GAAoG;AACpG,yEAAoE;AACpE,6GAAqG;AAIrG,SAAe,eAAe,CAAC,IAAU,EAAE,MAAgC;;QACzE,MAAM,IAAA,iBAAgB,EAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,IAAI;SACrB,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAsB,+BAA+B,CACnD,IAAU,EACV,MAAgC;;QAEhC,MAAM,WAAW,GAAG,MAAM,IAAA,kCAAsB,EAAC,IAAI,EAAE;YACrD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,yBAAyB;YACtC,gBAAgB,EAAE,KAAK;YACvB,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC,CAAC,CAAC;QAEH,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACpC,IAAA,6CAAoB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,IAAA,8EAAmC,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAClD,IAAA,6EAAkC,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEjD,IAAI,MAAM,CAAC,eAAe,EAAE;YAC1B,MAAM,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SACrC;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACxB,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AAzBD,0EAyBC;AAED,SAAS,gBAAgB,CAAC,IAAU,EAAE,WAAmB;IACvD,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAClE,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;QACnC,QAAQ,EAAE,8BAA8B;QACxC,OAAO,EAAE;YACP,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,UAAU,EAAE,8BAA8B;YAC1C,OAAO,EAAE,kCAAkC;YAC3C,MAAM,EAAE,KAAK;SACd;KACF,CAAC;IAEF,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;AAC/D,CAAC;AAED,kBAAe,+BAA+B,CAAC;AAClC,QAAA,+BAA+B,GAAG,IAAA,2BAAkB,EAC/D,+BAA+B,CAChC,CAAC"}
|
package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addResolverMainFieldsToMetroConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* Add resolverMainFields in metro.config.js
|
|
8
|
+
*/
|
|
9
|
+
function addResolverMainFieldsToMetroConfig(host, schema) {
|
|
10
|
+
const { root } = (0, devkit_1.readProjectConfiguration)(host, schema.name);
|
|
11
|
+
const metroConfigPath = (0, path_1.join)(root, 'metro.config.js');
|
|
12
|
+
try {
|
|
13
|
+
devkit_1.logger.debug(`Updating resolverMainFields for ${metroConfigPath}`);
|
|
14
|
+
const metroConfigContent = host.read(metroConfigPath, 'utf-8');
|
|
15
|
+
if (metroConfigContent.includes('resolverMainFields:')) {
|
|
16
|
+
devkit_1.logger.warn((0, devkit_1.stripIndents) `${metroConfigPath} is already udpated.`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
host.write(metroConfigPath, metroConfigContent.replace(/},\s+resolver: {/, `},resolver: { resolverMainFields: ['sbmodern', 'browser', 'main'],`));
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to update ${metroConfigPath} for project ${root}.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.addResolverMainFieldsToMetroConfig = addResolverMainFieldsToMetroConfig;
|
|
26
|
+
//# sourceMappingURL=add-resolver-main-fields-to-metro-config.js.map
|
package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-resolver-main-fields-to-metro-config.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AACtB,+BAA4B;AAI5B;;GAEG;AACH,SAAgB,kCAAkC,CAChD,IAAU,EACV,MAAgC;IAEhC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7D,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAEtD,IAAI;QACF,eAAM,CAAC,KAAK,CAAC,mCAAmC,eAAe,EAAE,CAAC,CAAC;QACnE,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAC/D,IAAI,kBAAkB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;YACtD,eAAM,CAAC,IAAI,CAAC,IAAA,qBAAY,EAAA,GAAG,eAAe,sBAAsB,CAAC,CAAC;YAClE,OAAO;SACR;QACD,IAAI,CAAC,KAAK,CACR,eAAe,EACf,kBAAkB,CAAC,OAAO,CACxB,kBAAkB,EAClB,oEAAoE,CACrE,CACF,CAAC;KACH;IAAC,WAAM;QACN,eAAM,CAAC,KAAK,CACV,IAAA,qBAAY,EAAA,oBAAoB,eAAe,gBAAgB,IAAI,GAAG,CACvE,CAAC;KACH;AACH,CAAC;AA3BD,gFA2BC"}
|
package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { addProjectConfiguration, Tree } from '@nrwl/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
|
+
|
|
4
|
+
import { formatFile } from '../../../utils/format-file';
|
|
5
|
+
|
|
6
|
+
import { addResolverMainFieldsToMetroConfig } from './add-resolver-main-fields-to-metro-config';
|
|
7
|
+
|
|
8
|
+
describe('addResolverMainFieldsToMetroConfig', () => {
|
|
9
|
+
let tree: Tree;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
tree = createTreeWithEmptyWorkspace();
|
|
13
|
+
|
|
14
|
+
addProjectConfiguration(tree, 'products', {
|
|
15
|
+
root: 'apps/products',
|
|
16
|
+
sourceRoot: 'apps/products/src',
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it(`should update metro.config.js and add key projectRoot`, async () => {
|
|
21
|
+
tree.write(
|
|
22
|
+
'apps/products/metro.config.js',
|
|
23
|
+
formatFile`
|
|
24
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
25
|
+
const { getDefaultConfig } = require('metro-config');
|
|
26
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
27
|
+
|
|
28
|
+
module.exports = (async () => {
|
|
29
|
+
const {
|
|
30
|
+
resolver: { sourceExts, assetExts },
|
|
31
|
+
} = await getDefaultConfig();
|
|
32
|
+
return withNxMetro(
|
|
33
|
+
{
|
|
34
|
+
transformer: {
|
|
35
|
+
getTransformOptions: async () => ({
|
|
36
|
+
transform: {
|
|
37
|
+
experimentalImportSupport: false,
|
|
38
|
+
inlineRequires: true,
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
42
|
+
},
|
|
43
|
+
resolver: {
|
|
44
|
+
|
|
45
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
46
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
47
|
+
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
})();`
|
|
52
|
+
);
|
|
53
|
+
addResolverMainFieldsToMetroConfig(tree, {
|
|
54
|
+
name: 'products',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
expect(
|
|
58
|
+
formatFile`${tree.read('apps/products/metro.config.js', 'utf-8')}`
|
|
59
|
+
).toEqual(
|
|
60
|
+
formatFile`
|
|
61
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
62
|
+
const { getDefaultConfig } = require('metro-config');
|
|
63
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
64
|
+
|
|
65
|
+
module.exports = (async () => {
|
|
66
|
+
const {
|
|
67
|
+
resolver: { sourceExts, assetExts },
|
|
68
|
+
} = await getDefaultConfig();
|
|
69
|
+
return withNxMetro(
|
|
70
|
+
{
|
|
71
|
+
transformer: {
|
|
72
|
+
getTransformOptions: async () => ({
|
|
73
|
+
transform: {
|
|
74
|
+
experimentalImportSupport: false,
|
|
75
|
+
inlineRequires: true,
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
79
|
+
},
|
|
80
|
+
resolver: {
|
|
81
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
82
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
83
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
84
|
+
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
})();`
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it(`should not udpate metro.config.js if projectRoot already exists`, async () => {
|
|
93
|
+
tree.write(
|
|
94
|
+
'apps/products/metro.config.js',
|
|
95
|
+
`
|
|
96
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
97
|
+
const { getDefaultConfig } = require('metro-config');
|
|
98
|
+
|
|
99
|
+
module.exports = (async () => {
|
|
100
|
+
const {
|
|
101
|
+
resolver: { sourceExts, assetExts },
|
|
102
|
+
} = await getDefaultConfig();
|
|
103
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
104
|
+
return withNxMetro(
|
|
105
|
+
{
|
|
106
|
+
transformer: {
|
|
107
|
+
getTransformOptions: async () => ({
|
|
108
|
+
transform: {
|
|
109
|
+
experimentalImportSupport: false,
|
|
110
|
+
inlineRequires: true,
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
114
|
+
},
|
|
115
|
+
resolver: {
|
|
116
|
+
resolverMainFields: ['main'],
|
|
117
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
118
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
})();
|
|
123
|
+
`
|
|
124
|
+
);
|
|
125
|
+
addResolverMainFieldsToMetroConfig(tree, {
|
|
126
|
+
name: 'products',
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
expect(tree.read('apps/products/metro.config.js', 'utf-8')).toEqual(
|
|
130
|
+
`
|
|
131
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
132
|
+
const { getDefaultConfig } = require('metro-config');
|
|
133
|
+
|
|
134
|
+
module.exports = (async () => {
|
|
135
|
+
const {
|
|
136
|
+
resolver: { sourceExts, assetExts },
|
|
137
|
+
} = await getDefaultConfig();
|
|
138
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
139
|
+
return withNxMetro(
|
|
140
|
+
{
|
|
141
|
+
transformer: {
|
|
142
|
+
getTransformOptions: async () => ({
|
|
143
|
+
transform: {
|
|
144
|
+
experimentalImportSupport: false,
|
|
145
|
+
inlineRequires: true,
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
149
|
+
},
|
|
150
|
+
resolver: {
|
|
151
|
+
resolverMainFields: ['main'],
|
|
152
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
153
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
);
|
|
157
|
+
})();
|
|
158
|
+
`
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addProjectConfiguration,
|
|
1
|
+
import { addProjectConfiguration, Tree } from '@nrwl/devkit';
|
|
2
2
|
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
3
|
|
|
4
4
|
import update from './add-project-root-metro-config-14-0-0';
|
|
@@ -22,7 +22,7 @@ describe('Add projectRoot option in metro.config.js', () => {
|
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
it(`should
|
|
25
|
+
it(`should update metro.config.js and add key projectRoot`, async () => {
|
|
26
26
|
tree.write(
|
|
27
27
|
'apps/products/metro.config.js',
|
|
28
28
|
`
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const reactNativeVersion = "0.69.
|
|
2
|
+
export declare const reactNativeVersion = "0.69.3";
|
|
3
3
|
export declare const typesReactNativeVersion = "0.69.3";
|
|
4
4
|
export declare const typesNodeVersion = "16.11.7";
|
|
5
5
|
export declare const metroVersion = "0.71.3";
|
|
6
|
-
export declare const reactNativeCommunityCli = "8.0.
|
|
7
|
-
export declare const reactNativeCommunityCliIos = "8.0.
|
|
8
|
-
export declare const reactNativeCommunityCliAndroid = "8.0.
|
|
6
|
+
export declare const reactNativeCommunityCli = "8.0.4";
|
|
7
|
+
export declare const reactNativeCommunityCliIos = "8.0.4";
|
|
8
|
+
export declare const reactNativeCommunityCliAndroid = "8.0.4";
|
|
9
9
|
export declare const reactNativeConfigVersion = "1.4.6";
|
|
10
10
|
export declare const reactNativeAsyncStorageAsyncStorageVersion = "1.17.7";
|
|
11
|
-
export declare const testingLibraryReactNativeVersion = "
|
|
11
|
+
export declare const testingLibraryReactNativeVersion = "11.0.0";
|
|
12
12
|
export declare const testingLibraryJestNativeVersion = "4.0.5";
|
|
13
13
|
export declare const jestReactNativeVersion = "18.0.0";
|
|
14
14
|
export declare const reactNativeSvgTransformerVersion = "1.0.0";
|
|
15
|
-
export declare const reactNativeSvgVersion = "12.3
|
|
16
|
-
export declare const babelRuntimeVersion = "7.18.
|
|
15
|
+
export declare const reactNativeSvgVersion = "12.4.3";
|
|
16
|
+
export declare const babelRuntimeVersion = "7.18.9";
|
package/src/utils/versions.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.reactNativeAsyncStorageAsyncStorageVersion = exports.reactNativeConfigVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.reactNativeVersion = '0.69.
|
|
5
|
+
exports.reactNativeVersion = '0.69.3';
|
|
6
6
|
exports.typesReactNativeVersion = '0.69.3';
|
|
7
7
|
exports.typesNodeVersion = '16.11.7';
|
|
8
8
|
exports.metroVersion = '0.71.3';
|
|
9
|
-
exports.reactNativeCommunityCli = '8.0.
|
|
10
|
-
exports.reactNativeCommunityCliIos = '8.0.
|
|
11
|
-
exports.reactNativeCommunityCliAndroid = '8.0.
|
|
9
|
+
exports.reactNativeCommunityCli = '8.0.4';
|
|
10
|
+
exports.reactNativeCommunityCliIos = '8.0.4';
|
|
11
|
+
exports.reactNativeCommunityCliAndroid = '8.0.4';
|
|
12
12
|
exports.reactNativeConfigVersion = '1.4.6';
|
|
13
13
|
exports.reactNativeAsyncStorageAsyncStorageVersion = '1.17.7';
|
|
14
|
-
exports.testingLibraryReactNativeVersion = '
|
|
14
|
+
exports.testingLibraryReactNativeVersion = '11.0.0';
|
|
15
15
|
exports.testingLibraryJestNativeVersion = '4.0.5';
|
|
16
16
|
exports.jestReactNativeVersion = '18.0.0';
|
|
17
17
|
exports.reactNativeSvgTransformerVersion = '1.0.0';
|
|
18
|
-
exports.reactNativeSvgVersion = '12.3
|
|
19
|
-
exports.babelRuntimeVersion = '7.18.
|
|
18
|
+
exports.reactNativeSvgVersion = '12.4.3';
|
|
19
|
+
exports.babelRuntimeVersion = '7.18.9';
|
|
20
20
|
//# sourceMappingURL=versions.js.map
|