@nrwl/react-native 14.0.0-beta.3 → 14.0.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/migrations.json +58 -0
- package/package.json +8 -8
- package/plugins/metro-resolver.js +16 -20
- package/plugins/metro-resolver.js.map +1 -1
- package/plugins/with-nx-metro.d.ts +2 -0
- package/plugins/with-nx-metro.js +16 -3
- package/plugins/with-nx-metro.js.map +1 -1
- package/src/generators/application/files/app/android/app/build.gradle.template +111 -22
- package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +1 -1
- package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +4 -3
- package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +4 -3
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +26 -46
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +27 -2
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +13 -2
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/newarchitecture/MainApplicationReactNativeHost.java.template +116 -0
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/newarchitecture/components/MainComponentsRegistry.java.template +36 -0
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java.template +48 -0
- package/src/generators/application/files/app/android/app/src/main/jni/Android.mk.template +49 -0
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -0
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h.template +38 -0
- package/src/generators/application/files/app/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -0
- package/src/generators/application/files/app/android/app/src/main/jni/MainComponentsRegistry.h.template +32 -0
- package/src/generators/application/files/app/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/src/generators/application/files/app/android/build.gradle.template +22 -9
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +2 -2
- package/src/generators/application/files/app/android/gradle.properties +15 -10
- package/src/generators/application/files/app/android/gradlew.bat +234 -89
- package/src/generators/application/files/app/android/gradlew.template +154 -105
- package/src/generators/application/files/app/android/settings.gradle.template +6 -0
- package/src/generators/application/files/app/ios/Podfile.template +9 -2
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +108 -0
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/AppIcon.appiconset/Contents.json +29 -14
- package/src/generators/application/files/app/ios/__className__/main.m +3 -3
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +48 -37
- package/src/generators/application/files/app/metro.config.js.template +5 -1
- package/src/generators/application/files/app/src/app/App.spec.tsx.template +1 -1
- package/src/generators/application/files/app/src/main.tsx.template +1 -1
- package/src/generators/application/files/app/tsconfig.app.json.template +1 -1
- package/src/generators/application/lib/add-project.js +2 -2
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/application/lib/create-application-files.js +1 -1
- package/src/generators/application/lib/create-application-files.js.map +1 -1
- package/src/generators/application/lib/nomalize-options.spec.ts +5 -10
- package/src/generators/application/lib/normalize-options.d.ts +0 -1
- package/src/generators/application/lib/normalize-options.js +2 -4
- package/src/generators/application/lib/normalize-options.js.map +1 -1
- package/src/generators/init/init.js +2 -8
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/init/init.spec.ts +0 -25
- package/src/generators/init/lib/gitignore-entries.d.ts +1 -1
- package/src/generators/init/lib/gitignore-entries.js +25 -17
- package/src/generators/init/lib/gitignore-entries.js.map +1 -1
- package/src/generators/library/library.spec.ts +1 -1
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.d.ts +6 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +35 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js.map +1 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +188 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.d.ts +5 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js +39 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js.map +1 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +84 -0
- package/src/utils/add-jest.js +2 -2
- package/src/utils/versions.d.ts +7 -8
- package/src/utils/versions.js +9 -13
- package/src/utils/versions.js.map +1 -1
- package/src/generators/application/files/app/ios/__className__/AppDelegate.m.template +0 -62
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,+BAA4B;
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,+BAA4B;AAc5B,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS;QACrC,CAAC,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ;QACnC,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,gBAAgB,GAAG,aAAa;QACpC,CAAC,CAAC,GAAG,aAAa,IAAI,QAAQ,EAAE;QAChC,CAAC,CAAC,QAAQ,CAAC;IAEb,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAE3E,MAAM,cAAc,GAAG,QAAQ,gBAAgB,EAAE,CAAC;IAClD,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,kBAAkB,GAAG,IAAA,WAAI,EAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAE3D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI;QAC7B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;IAE9D;;;;;OAKG;IACH,uCACK,OAAO,KACV,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,MAAM,EAChD,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,EAC/C,IAAI,EAAE,QAAQ,EACd,SAAS,EACT,aAAa,EAAE,SAAS,CAAC,WAAW,EAAE,EACtC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,SAAS,EAC7C,WAAW,EAAE,cAAc,EAC3B,cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,UAAU;QACV,SAAS,IACT;AACJ,CAAC;AA3CD,4CA2CC"}
|
|
@@ -33,17 +33,11 @@ function reactNativeInitGenerator(host, schema) {
|
|
|
33
33
|
}
|
|
34
34
|
exports.reactNativeInitGenerator = reactNativeInitGenerator;
|
|
35
35
|
function updateDependencies(host) {
|
|
36
|
-
var _a;
|
|
37
36
|
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
|
-
}
|
|
43
37
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
44
|
-
react:
|
|
38
|
+
react: versions_1.reactVersion,
|
|
45
39
|
'react-native': versions_2.reactNativeVersion,
|
|
46
|
-
}, Object.assign({ '@nrwl/react-native': versions_2.nxVersion, '@types/node': versions_2.typesNodeVersion, '@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
|
|
40
|
+
}, Object.assign({ '@nrwl/react-native': versions_2.nxVersion, '@types/node': versions_2.typesNodeVersion, '@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, 'metro-babel-register': 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
|
|
47
41
|
? {
|
|
48
42
|
'metro-config': versions_2.metroVersion,
|
|
49
43
|
'@babel/runtime': versions_2.babelRuntimeVersion, // @babel/runtime is used by react-native-svg
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,iGAA4F;AAC5F,yCASsB;AAEtB,2FAAqF;AACrF,qCAA+C;AAC/C,uCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,iGAA4F;AAC5F,yCASsB;AAEtB,2FAAqF;AACrF,qCAA+C;AAC/C,uCAAiD;AACjD,6DAGwC;AAExC,mDAmB8B;AAE9B,qEAA+D;AAC/D,yEAAmE;AAEnE,SAAsB,wBAAwB,CAAC,IAAU,EAAE,MAAc;;QACvE,IAAA,6CAAoB,EAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;QACjD,IAAA,wCAAiB,EAAC,IAAI,CAAC,CAAC;QACxB,IAAA,4CAAmB,EAAC,IAAI,CAAC,CAAC;QAE1B,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;QAE/D,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,KAAK,MAAM,EAAE;YAC9D,MAAM,QAAQ,GAAG,IAAA,wBAAiB,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACtB;QAED,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,KAAK,OAAO,EAAE;YAC7D,MAAM,SAAS,GAAG,MAAM,IAAA,0BAAkB,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACrD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACvB;QAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,sCAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAtBD,4DAsBC;AAED,SAAgB,kBAAkB,CAAC,IAAU;IAC3C,MAAM,MAAM,GAAG,IAAA,6BAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC;IAC1D,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ;QACE,KAAK,EAAE,uBAAY;QACnB,cAAc,EAAE,6BAAkB;KACnC,kBAEC,oBAAoB,EAAE,oBAAS,EAC/B,aAAa,EAAE,2BAAgB,EAC/B,cAAc,EAAE,4BAAiB,EACjC,qBAAqB,EAAE,kCAAuB,EAC9C,6BAA6B,EAAE,kCAAuB,EACtD,8CAA8C,EAC5C,yCAA8B,EAChC,0CAA0C,EAAE,qCAA0B,EACtE,iCAAiC,EAAE,6CAAkC,EACrE,+BAA+B,EAAE,2CAAgC,EACjE,8BAA8B,EAAE,0CAA+B,EAC/D,mBAAmB,EAAE,iCAAsB,EAC3C,KAAK,EAAE,uBAAY,EACnB,gBAAgB,EAAE,uBAAY,EAC9B,sBAAsB,EAAE,uBAAY,EACpC,qBAAqB,EAAE,mCAAwB,EAC/C,8BAA8B,EAAE,2CAAgC,EAChE,kBAAkB,EAAE,gCAAqB,EACzC,qBAAqB,EAAE,mCAAwB,EAC/C,2CAA2C,EACzC,qDAA0C,IACzC,CAAC,MAAM;QACR,CAAC,CAAC;YACE,cAAc,EAAE,uBAAY;YAC5B,gBAAgB,EAAE,8BAAmB,EAAE,6CAA6C;SACrF;QACH,CAAC,CAAC,EAAE,CAAC,EAEV,CAAC;AACJ,CAAC;AAtCD,gDAsCC;AAED,SAAS,cAAc,CAAC,IAAU;IAChC,OAAO,IAAA,0CAAiC,EAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,kBAAe,wBAAwB,CAAC;AAC3B,QAAA,wBAAwB,GAAG,IAAA,2BAAkB,EACxD,wBAAwB,CACzB,CAAC"}
|
|
@@ -36,31 +36,6 @@ describe('init', () => {
|
|
|
36
36
|
expect(content).toMatch(/# Nested node_modules/);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
it.each`
|
|
40
|
-
version
|
|
41
|
-
${'18.0.0'}
|
|
42
|
-
${'~18.0.0'}
|
|
43
|
-
${'^18.0.0'}
|
|
44
|
-
`(
|
|
45
|
-
'should warn if React v18 is already installed in workspace',
|
|
46
|
-
async ({ version }) => {
|
|
47
|
-
const spy = jest.spyOn(logger, 'warn');
|
|
48
|
-
spy.mockImplementation(() => {});
|
|
49
|
-
updateJson(tree, 'package.json', (json) => {
|
|
50
|
-
json.dependencies = {
|
|
51
|
-
react: version,
|
|
52
|
-
};
|
|
53
|
-
return json;
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
await reactNativeInitGenerator(tree, { e2eTestRunner: 'none' });
|
|
57
|
-
|
|
58
|
-
expect(spy).toHaveBeenCalledWith(expect.stringContaining('incompatible'));
|
|
59
|
-
|
|
60
|
-
spy.mockRestore();
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
|
|
64
39
|
describe('defaultCollection', () => {
|
|
65
40
|
it('should be set if none was set before', async () => {
|
|
66
41
|
await reactNativeInitGenerator(tree, { e2eTestRunner: 'none' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const gitIgnoreEntriesForReactNative = "\n# React Native\n\n
|
|
1
|
+
export declare const gitIgnoreEntriesForReactNative = "\n# React Native\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\n\n# Android/IntelliJ\n#\nbuild/\n.idea\n.gradle\nlocal.properties\n*.iml\n*.hprof\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\nyarn-error.log\n\n# BUCK\nbuck-out/\n.buckd/\n*.keystore\n!debug.keystore\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://docs.fastlane.tools/best-practices/source-control/\n\n*/fastlane/report.xml\n*/fastlane/Preview.html\n*/fastlane/screenshots\n\n# Bundle artifact\n*.jsbundle\n\n# Ruby / CocoaPods\n/ios/Pods/\n/vendor/bundle/\n";
|
|
@@ -4,10 +4,10 @@ exports.gitIgnoreEntriesForReactNative = void 0;
|
|
|
4
4
|
exports.gitIgnoreEntriesForReactNative = `
|
|
5
5
|
# React Native
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
# Xcode
|
|
8
|
+
#
|
|
9
|
+
build/
|
|
10
|
+
*.pbxuser
|
|
11
11
|
!default.pbxuser
|
|
12
12
|
*.mode1v3
|
|
13
13
|
!default.mode1v3
|
|
@@ -23,35 +23,43 @@ DerivedData
|
|
|
23
23
|
*.ipa
|
|
24
24
|
*.xcuserstate
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
# Android/IntelliJ
|
|
27
|
+
#
|
|
28
|
+
build/
|
|
29
|
+
.idea
|
|
30
|
+
.gradle
|
|
31
|
+
local.properties
|
|
32
|
+
*.iml
|
|
33
|
+
*.hprof
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
# node.js
|
|
36
|
+
#
|
|
37
|
+
node_modules/
|
|
38
|
+
npm-debug.log
|
|
39
|
+
yarn-error.log
|
|
34
40
|
|
|
41
|
+
# BUCK
|
|
35
42
|
buck-out/
|
|
36
|
-
|
|
43
|
+
\.buckd/
|
|
37
44
|
*.keystore
|
|
38
45
|
!debug.keystore
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
# fastlane
|
|
41
48
|
#
|
|
42
49
|
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
|
43
50
|
# screenshots whenever they are needed.
|
|
44
51
|
# For more information about the recommended setup visit:
|
|
45
52
|
# https://docs.fastlane.tools/best-practices/source-control/
|
|
46
|
-
|
|
53
|
+
|
|
47
54
|
*/fastlane/report.xml
|
|
48
55
|
*/fastlane/Preview.html
|
|
49
56
|
*/fastlane/screenshots
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
# Bundle artifact
|
|
52
59
|
*.jsbundle
|
|
53
60
|
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
# Ruby / CocoaPods
|
|
62
|
+
/ios/Pods/
|
|
63
|
+
/vendor/bundle/
|
|
56
64
|
`;
|
|
57
65
|
//# sourceMappingURL=gitignore-entries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitignore-entries.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/init/lib/gitignore-entries.ts"],"names":[],"mappings":";;;AAAa,QAAA,8BAA8B,GAAG
|
|
1
|
+
{"version":3,"file":"gitignore-entries.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/init/lib/gitignore-entries.ts"],"names":[],"mappings":";;;AAAa,QAAA,8BAA8B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D7C,CAAC"}
|
|
@@ -226,7 +226,7 @@ describe('lib', () => {
|
|
|
226
226
|
});
|
|
227
227
|
|
|
228
228
|
expect(appTree.exists('libs/my-lib/tsconfig.spec.json')).toBeFalsy();
|
|
229
|
-
expect(appTree.exists('libs/my-lib/jest.config.
|
|
229
|
+
expect(appTree.exists('libs/my-lib/jest.config.ts')).toBeFalsy();
|
|
230
230
|
const workspaceJson = readJson(appTree, 'workspace.json');
|
|
231
231
|
expect(workspaceJson.projects['my-lib'].architect.test).toBeUndefined();
|
|
232
232
|
expect(workspaceJson.projects['my-lib'].architect.lint)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* Add projectRoot and watchFolders options in metro.config.js
|
|
7
|
+
* @param tree
|
|
8
|
+
*/
|
|
9
|
+
function update(tree) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
+
projects.forEach((project) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const metroConfigPath = `${project.root}/metro.config.js`;
|
|
15
|
+
if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/react-native:start' ||
|
|
16
|
+
!tree.exists(metroConfigPath))
|
|
17
|
+
return;
|
|
18
|
+
try {
|
|
19
|
+
const metroConfigContent = tree.read(metroConfigPath, 'utf-8');
|
|
20
|
+
if (metroConfigContent.includes('projectRoot: __dirname')) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (metroConfigContent.includes('projectRoot'))
|
|
24
|
+
return;
|
|
25
|
+
tree.write(metroConfigPath, metroConfigContent.replace('debug: ', 'projectRoot: __dirname, watchFolders: [], debug: '));
|
|
26
|
+
}
|
|
27
|
+
catch (_c) {
|
|
28
|
+
devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to update ${metroConfigPath} for project ${project.root}.`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.default = update;
|
|
35
|
+
//# sourceMappingURL=add-project-root-metro-config-14-0-0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-project-root-metro-config-14-0-0.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AAEtB;;;GAGG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,MAAM,eAAe,GAAG,GAAG,OAAO,CAAC,IAAI,kBAAkB,CAAC;YAC1D,IACE,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B;gBAC/D,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;gBAE7B,OAAO;YACT,IAAI;gBACF,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAC/D,IAAI,kBAAkB,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE;oBACzD,OAAO;iBACR;gBACD,IAAI,kBAAkB,CAAC,QAAQ,CAAC,aAAa,CAAC;oBAAE,OAAO;gBACvD,IAAI,CAAC,KAAK,CACR,eAAe,EACf,kBAAkB,CAAC,OAAO,CACxB,SAAS,EACT,mDAAmD,CACpD,CACF,CAAC;aACH;YAAC,WAAM;gBACN,eAAM,CAAC,KAAK,CACV,IAAA,qBAAY,EAAA,oBAAoB,eAAe,gBAAgB,OAAO,CAAC,IAAI,GAAG,CAC/E,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA9BD,yBA8BC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
|
+
|
|
4
|
+
import update from './add-project-root-metro-config-14-0-0';
|
|
5
|
+
|
|
6
|
+
describe('Add projectRoot option in metro.config.js', () => {
|
|
7
|
+
let tree: Tree;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tree = createTreeWithEmptyWorkspace();
|
|
11
|
+
addProjectConfiguration(tree, 'products', {
|
|
12
|
+
root: 'apps/products',
|
|
13
|
+
sourceRoot: 'apps/products/src',
|
|
14
|
+
targets: {
|
|
15
|
+
start: {
|
|
16
|
+
executor: '@nrwl/react-native:start',
|
|
17
|
+
options: {
|
|
18
|
+
port: 8081,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it(`should udpate metro.config.js and add key projectRoot`, async () => {
|
|
26
|
+
tree.write(
|
|
27
|
+
'apps/products/metro.config.js',
|
|
28
|
+
`
|
|
29
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
30
|
+
const { getDefaultConfig } = require('metro-config');
|
|
31
|
+
|
|
32
|
+
module.exports = (async () => {
|
|
33
|
+
const {
|
|
34
|
+
resolver: { sourceExts, assetExts },
|
|
35
|
+
} = await getDefaultConfig();
|
|
36
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
37
|
+
return withNxMetro(
|
|
38
|
+
{
|
|
39
|
+
transformer: {
|
|
40
|
+
getTransformOptions: async () => ({
|
|
41
|
+
transform: {
|
|
42
|
+
experimentalImportSupport: false,
|
|
43
|
+
inlineRequires: true,
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
47
|
+
},
|
|
48
|
+
resolver: {
|
|
49
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
50
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
51
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
// Change this to true to see debugging info.
|
|
56
|
+
// Useful if you have issues resolving modules
|
|
57
|
+
debug: false,
|
|
58
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
59
|
+
extensions: [],
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
})();
|
|
63
|
+
`
|
|
64
|
+
);
|
|
65
|
+
await update(tree);
|
|
66
|
+
|
|
67
|
+
expect(tree.read('apps/products/metro.config.js', 'utf-8')).toEqual(`
|
|
68
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
69
|
+
const { getDefaultConfig } = require('metro-config');
|
|
70
|
+
|
|
71
|
+
module.exports = (async () => {
|
|
72
|
+
const {
|
|
73
|
+
resolver: { sourceExts, assetExts },
|
|
74
|
+
} = await getDefaultConfig();
|
|
75
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
76
|
+
return withNxMetro(
|
|
77
|
+
{
|
|
78
|
+
transformer: {
|
|
79
|
+
getTransformOptions: async () => ({
|
|
80
|
+
transform: {
|
|
81
|
+
experimentalImportSupport: false,
|
|
82
|
+
inlineRequires: true,
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
86
|
+
},
|
|
87
|
+
resolver: {
|
|
88
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
89
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
90
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
// Change this to true to see debugging info.
|
|
95
|
+
// Useful if you have issues resolving modules
|
|
96
|
+
projectRoot: __dirname, watchFolders: [], debug: false,
|
|
97
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
98
|
+
extensions: [],
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
})();
|
|
102
|
+
`);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it(`should not udpate metro.config.js if projectRoot already exists`, async () => {
|
|
106
|
+
tree.write(
|
|
107
|
+
'apps/products/metro.config.js',
|
|
108
|
+
`
|
|
109
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
110
|
+
const { getDefaultConfig } = require('metro-config');
|
|
111
|
+
|
|
112
|
+
module.exports = (async () => {
|
|
113
|
+
const {
|
|
114
|
+
resolver: { sourceExts, assetExts },
|
|
115
|
+
} = await getDefaultConfig();
|
|
116
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
117
|
+
return withNxMetro(
|
|
118
|
+
{
|
|
119
|
+
transformer: {
|
|
120
|
+
getTransformOptions: async () => ({
|
|
121
|
+
transform: {
|
|
122
|
+
experimentalImportSupport: false,
|
|
123
|
+
inlineRequires: true,
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
127
|
+
},
|
|
128
|
+
resolver: {
|
|
129
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
130
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
131
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
projectRoot: __dirname,
|
|
136
|
+
// Change this to true to see debugging info.
|
|
137
|
+
// Useful if you have issues resolving modules
|
|
138
|
+
debug: false,
|
|
139
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
140
|
+
extensions: [],
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
})();
|
|
144
|
+
`
|
|
145
|
+
);
|
|
146
|
+
await update(tree);
|
|
147
|
+
|
|
148
|
+
expect(tree.read('apps/products/metro.config.js', 'utf-8')).toEqual(
|
|
149
|
+
`
|
|
150
|
+
const { withNxMetro } = require('@nrwl/react-native');
|
|
151
|
+
const { getDefaultConfig } = require('metro-config');
|
|
152
|
+
|
|
153
|
+
module.exports = (async () => {
|
|
154
|
+
const {
|
|
155
|
+
resolver: { sourceExts, assetExts },
|
|
156
|
+
} = await getDefaultConfig();
|
|
157
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
158
|
+
return withNxMetro(
|
|
159
|
+
{
|
|
160
|
+
transformer: {
|
|
161
|
+
getTransformOptions: async () => ({
|
|
162
|
+
transform: {
|
|
163
|
+
experimentalImportSupport: false,
|
|
164
|
+
inlineRequires: true,
|
|
165
|
+
},
|
|
166
|
+
}),
|
|
167
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
168
|
+
},
|
|
169
|
+
resolver: {
|
|
170
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
171
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
172
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
projectRoot: __dirname,
|
|
177
|
+
// Change this to true to see debugging info.
|
|
178
|
+
// Useful if you have issues resolving modules
|
|
179
|
+
debug: false,
|
|
180
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
181
|
+
extensions: [],
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
})();
|
|
185
|
+
`
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* This function udpate the entry file option under bundle target for react native apps
|
|
8
|
+
*/
|
|
9
|
+
function update(tree) {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
13
|
+
const updateTargetEntryFile = (target, config) => {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
if (!((_c = (_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a[target]) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.entryFile)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (tree.exists((0, path_1.join)(config.root, 'src/main.tsx'))) {
|
|
19
|
+
config.targets[target].options.entryFile = `src/main.tsx`;
|
|
20
|
+
}
|
|
21
|
+
if (tree.exists((0, path_1.join)(config.root, 'src/main.js'))) {
|
|
22
|
+
config.targets[target].options.entryFile = `src/main.js`;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
for (const [name, config] of projects.entries()) {
|
|
26
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['bundle-ios']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/react-native:bundle') {
|
|
27
|
+
updateTargetEntryFile('bundle-ios', config);
|
|
28
|
+
}
|
|
29
|
+
if (((_d = (_c = config.targets) === null || _c === void 0 ? void 0 : _c['bundle-android']) === null || _d === void 0 ? void 0 : _d.executor) ===
|
|
30
|
+
'@nrwl/react-native:bundle') {
|
|
31
|
+
updateTargetEntryFile('bundle-android', config);
|
|
32
|
+
}
|
|
33
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
34
|
+
}
|
|
35
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.default = update;
|
|
39
|
+
//# sourceMappingURL=update-entry-file-bundle-14-0-0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-entry-file-bundle-14-0-0.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AACtB,+BAA4B;AAE5B;;GAEG;AACH,SAA8B,MAAM,CAAC,IAAU;;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,MAAM,qBAAqB,GAAG,CAAC,MAAc,EAAE,MAAM,EAAE,EAAE;;YACvD,IAAI,CAAC,CAAA,MAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,MAAM,CAAC,0CAAE,OAAO,0CAAE,SAAS,CAAA,EAAE;gBACjD,OAAO;aACR;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE;gBAClD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,GAAG,cAAc,CAAC;aAC3D;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,EAAE;gBACjD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,GAAG,aAAa,CAAC;aAC1D;QACH,CAAC,CAAC;QAEF,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;YAC/C,IACE,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,YAAY,CAAC,0CAAE,QAAQ,MAAK,2BAA2B,EACxE;gBACA,qBAAqB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;aAC7C;YAED,IACE,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,gBAAgB,CAAC,0CAAE,QAAQ;gBAC5C,2BAA2B,EAC3B;gBACA,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;aACjD;YAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SAChD;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AAjCD,yBAiCC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { addProjectConfiguration, Tree, getProjects } from '@nrwl/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
|
+
|
|
4
|
+
import update from './update-entry-file-bundle-14-0-0';
|
|
5
|
+
|
|
6
|
+
describe('Update entryFile for bundle target for react native apps', () => {
|
|
7
|
+
let tree: Tree;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tree = createTreeWithEmptyWorkspace();
|
|
11
|
+
addProjectConfiguration(tree, 'products', {
|
|
12
|
+
root: 'apps/products',
|
|
13
|
+
sourceRoot: 'apps/products/src',
|
|
14
|
+
targets: {
|
|
15
|
+
'bundle-ios': {
|
|
16
|
+
executor: '@nrwl/react-native:bundle',
|
|
17
|
+
options: {
|
|
18
|
+
entryFile: 'apps/mobile/src/main.tsx',
|
|
19
|
+
platform: 'ios',
|
|
20
|
+
bundleOutput: 'dist/apps/mobile/ios/main.jsbundle',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
'bundle-android': {
|
|
24
|
+
executor: '@nrwl/react-native:bundle',
|
|
25
|
+
options: {
|
|
26
|
+
entryFile: 'apps/mobile/src/main.tsx',
|
|
27
|
+
platform: 'android',
|
|
28
|
+
bundleOutput: 'dist/apps/mobile/android/main.jsbundle',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it(`should update entryFile option`, async () => {
|
|
36
|
+
tree.write('apps/products/src/main.tsx', '');
|
|
37
|
+
|
|
38
|
+
await update(tree);
|
|
39
|
+
|
|
40
|
+
getProjects(tree).forEach((project) => {
|
|
41
|
+
expect(project.targets['bundle-ios']).toEqual({
|
|
42
|
+
executor: '@nrwl/react-native:bundle',
|
|
43
|
+
options: {
|
|
44
|
+
entryFile: 'src/main.tsx',
|
|
45
|
+
platform: 'ios',
|
|
46
|
+
bundleOutput: 'dist/apps/mobile/ios/main.jsbundle',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
expect(project.targets['bundle-android']).toEqual({
|
|
51
|
+
executor: '@nrwl/react-native:bundle',
|
|
52
|
+
options: {
|
|
53
|
+
entryFile: 'src/main.tsx',
|
|
54
|
+
platform: 'android',
|
|
55
|
+
bundleOutput: 'dist/apps/mobile/android/main.jsbundle',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it(`should not update entryFile option if the file does not exist`, async () => {
|
|
62
|
+
await update(tree);
|
|
63
|
+
|
|
64
|
+
getProjects(tree).forEach((project) => {
|
|
65
|
+
expect(project.targets['bundle-ios']).toEqual({
|
|
66
|
+
executor: '@nrwl/react-native:bundle',
|
|
67
|
+
options: {
|
|
68
|
+
entryFile: 'apps/mobile/src/main.tsx',
|
|
69
|
+
platform: 'ios',
|
|
70
|
+
bundleOutput: 'dist/apps/mobile/ios/main.jsbundle',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
expect(project.targets['bundle-android']).toEqual({
|
|
75
|
+
executor: '@nrwl/react-native:bundle',
|
|
76
|
+
options: {
|
|
77
|
+
entryFile: 'apps/mobile/src/main.tsx',
|
|
78
|
+
platform: 'android',
|
|
79
|
+
bundleOutput: 'dist/apps/mobile/android/main.jsbundle',
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
package/src/utils/add-jest.js
CHANGED
|
@@ -15,8 +15,8 @@ function addJest(host, unitTestRunner, projectName, appProjectRoot, js) {
|
|
|
15
15
|
setupFile: 'none',
|
|
16
16
|
compiler: 'babel',
|
|
17
17
|
});
|
|
18
|
-
// overwrite the jest.config.
|
|
19
|
-
const configPath = `${appProjectRoot}/jest.config.
|
|
18
|
+
// overwrite the jest.config.ts file because react native needs to have special transform property
|
|
19
|
+
const configPath = `${appProjectRoot}/jest.config.ts`;
|
|
20
20
|
const content = `module.exports = {
|
|
21
21
|
displayName: '${projectName}',
|
|
22
22
|
preset: 'react-native',
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
export declare const nxVersion = "*";
|
|
2
|
-
export declare const reactNativeVersion = "0.
|
|
3
|
-
export declare const typesReactNativeVersion = "0.67.
|
|
2
|
+
export declare const reactNativeVersion = "0.68.1";
|
|
3
|
+
export declare const typesReactNativeVersion = "0.67.4";
|
|
4
4
|
export declare const typesNodeVersion = "16.11.7";
|
|
5
|
-
export declare const metroVersion = "0.70.
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const reactNativeCommunityCli = "7.0.1";
|
|
5
|
+
export declare const metroVersion = "0.70.1";
|
|
6
|
+
export declare const reactNativeCommunityCli = "7.0.3";
|
|
8
7
|
export declare const reactNativeCommunityCliIos = "7.0.1";
|
|
9
8
|
export declare const reactNativeCommunityCliAndroid = "7.0.1";
|
|
10
9
|
export declare const reactNativeConfigVersion = "1.4.5";
|
|
11
10
|
export declare const reactNativeAsyncStorageAsyncStorageVersion = "1.16.3";
|
|
12
|
-
export declare const metroReactNativeBabelPresetVersion = "0.70.
|
|
11
|
+
export declare const metroReactNativeBabelPresetVersion = "0.70.1";
|
|
13
12
|
export declare const testingLibraryReactNativeVersion = "9.1.0";
|
|
14
13
|
export declare const testingLibraryJestNativeVersion = "4.0.4";
|
|
15
14
|
export declare const jestReactNativeVersion = "18.0.0";
|
|
16
|
-
export declare const reactTestRendererVersion = "
|
|
15
|
+
export declare const reactTestRendererVersion = "18.0.0";
|
|
17
16
|
export declare const reactNativeSvgTransformerVersion = "1.0.0";
|
|
18
17
|
export declare const reactNativeSvgVersion = "12.3.0";
|
|
19
|
-
export declare const babelRuntimeVersion = "7.17.
|
|
18
|
+
export declare const babelRuntimeVersion = "7.17.9";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
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.
|
|
4
|
-
exports.nxVersion = '14.0.0
|
|
5
|
-
exports.reactNativeVersion = '0.
|
|
6
|
-
exports.typesReactNativeVersion = '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.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
|
+
exports.nxVersion = '14.0.0';
|
|
5
|
+
exports.reactNativeVersion = '0.68.1';
|
|
6
|
+
exports.typesReactNativeVersion = '0.67.4';
|
|
7
7
|
exports.typesNodeVersion = '16.11.7';
|
|
8
|
-
exports.metroVersion = '0.70.
|
|
9
|
-
|
|
10
|
-
// v18 is only supported on the New Architecture
|
|
11
|
-
// See: https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout
|
|
12
|
-
exports.reactVersion = '17.0.2';
|
|
13
|
-
exports.reactNativeCommunityCli = '7.0.1';
|
|
8
|
+
exports.metroVersion = '0.70.1';
|
|
9
|
+
exports.reactNativeCommunityCli = '7.0.3';
|
|
14
10
|
exports.reactNativeCommunityCliIos = '7.0.1';
|
|
15
11
|
exports.reactNativeCommunityCliAndroid = '7.0.1';
|
|
16
12
|
exports.reactNativeConfigVersion = '1.4.5';
|
|
17
13
|
exports.reactNativeAsyncStorageAsyncStorageVersion = '1.16.3';
|
|
18
|
-
exports.metroReactNativeBabelPresetVersion = '0.70.
|
|
14
|
+
exports.metroReactNativeBabelPresetVersion = '0.70.1';
|
|
19
15
|
exports.testingLibraryReactNativeVersion = '9.1.0';
|
|
20
16
|
exports.testingLibraryJestNativeVersion = '4.0.4';
|
|
21
17
|
exports.jestReactNativeVersion = '18.0.0';
|
|
22
|
-
exports.reactTestRendererVersion = '
|
|
18
|
+
exports.reactTestRendererVersion = '18.0.0';
|
|
23
19
|
exports.reactNativeSvgTransformerVersion = '1.0.0';
|
|
24
20
|
exports.reactNativeSvgVersion = '12.3.0';
|
|
25
|
-
exports.babelRuntimeVersion = '7.17.
|
|
21
|
+
exports.babelRuntimeVersion = '7.17.9';
|
|
26
22
|
//# 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,GAAG,CAAC;AAEhB,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAC9B,QAAA,uBAAuB,GAAG,QAAQ,CAAC;AAEnC,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAE7B,QAAA,YAAY,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,GAAG,CAAC;AAEhB,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAC9B,QAAA,uBAAuB,GAAG,QAAQ,CAAC;AAEnC,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAE7B,QAAA,YAAY,GAAG,QAAQ,CAAC;AAExB,QAAA,uBAAuB,GAAG,OAAO,CAAC;AAClC,QAAA,0BAA0B,GAAG,OAAO,CAAC;AACrC,QAAA,8BAA8B,GAAG,OAAO,CAAC;AAEzC,QAAA,wBAAwB,GAAG,OAAO,CAAC;AACnC,QAAA,0CAA0C,GAAG,QAAQ,CAAC;AAEtD,QAAA,kCAAkC,GAAG,QAAQ,CAAC;AAE9C,QAAA,gCAAgC,GAAG,OAAO,CAAC;AAC3C,QAAA,+BAA+B,GAAG,OAAO,CAAC;AAE1C,QAAA,sBAAsB,GAAG,QAAQ,CAAC;AAElC,QAAA,wBAAwB,GAAG,QAAQ,CAAC;AAEpC,QAAA,gCAAgC,GAAG,OAAO,CAAC;AAC3C,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AAEjC,QAAA,mBAAmB,GAAG,QAAQ,CAAC"}
|