@nx/react-native 16.6.0-beta.3 → 16.6.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +23 -0
- package/migrations.json +78 -0
- package/package.json +15 -13
- package/plugins/with-nx-metro.d.ts +5 -1
- package/plugins/with-nx-metro.js +27 -22
- package/src/executors/build-android/build-android.impl.js +18 -32
- package/src/executors/build-android/build-android.impl.ts +21 -50
- package/src/executors/build-android/schema.d.ts +5 -3
- package/src/executors/build-android/schema.json +14 -8
- package/src/executors/build-ios/build-ios.impl.d.ts +1 -1
- package/src/executors/build-ios/build-ios.impl.js +23 -42
- package/src/executors/build-ios/build-ios.impl.ts +26 -64
- package/src/executors/build-ios/schema.d.ts +3 -0
- package/src/executors/build-ios/schema.json +8 -6
- package/src/executors/bundle/bundle.impl.js +19 -17
- package/src/executors/bundle/bundle.impl.ts +24 -23
- package/src/executors/pod-install/pod-install.impl.js +1 -1
- package/src/executors/pod-install/pod-install.impl.ts +1 -1
- package/src/executors/pod-install/schema.d.ts +3 -1
- package/src/executors/pod-install/schema.json +11 -1
- package/src/executors/run-android/run-android.impl.js +47 -26
- package/src/executors/run-android/run-android.impl.ts +40 -45
- package/src/executors/run-android/schema.d.ts +2 -2
- package/src/executors/run-android/schema.json +9 -5
- package/src/executors/run-ios/run-ios.impl.js +47 -31
- package/src/executors/run-ios/run-ios.impl.ts +42 -56
- package/src/executors/run-ios/schema.d.ts +1 -1
- package/src/executors/run-ios/schema.json +7 -6
- package/src/executors/start/start.impl.d.ts +4 -2
- package/src/executors/start/start.impl.js +35 -24
- package/src/executors/start/start.impl.ts +42 -35
- package/src/executors/storybook/schema.d.ts +1 -1
- package/src/generators/application/application.js +1 -3
- package/src/generators/application/files/app/Gemfile.template +2 -2
- package/src/generators/application/files/app/android/app/build.gradle.template +2 -49
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +1 -4
- package/src/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +1 -1
- package/src/generators/application/files/app/android/build.gradle.template +1 -1
- 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 -1
- package/src/generators/application/files/app/android/gradle.properties +1 -1
- package/src/generators/application/files/app/android/gradlew.bat +9 -6
- package/src/generators/application/files/app/android/gradlew.template +14 -4
- package/src/generators/application/files/app/android/settings.gradle.template +1 -2
- package/src/generators/application/files/app/ios/Podfile.template +8 -6
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +0 -10
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +6 -2
- package/src/generators/application/files/app/metro.config.js.template +32 -35
- package/src/generators/application/files/app/package.json.template +1 -0
- package/src/generators/application/files/app/src/app/App.tsx.template +1 -1
- package/src/generators/application/files/app/tsconfig.app.json.template +1 -0
- package/src/generators/application/files/app/tsconfig.json.template +1 -7
- package/src/generators/application/lib/add-project.js +7 -0
- package/src/generators/init/init.js +1 -2
- package/src/generators/library/library.js +5 -1
- package/src/migrations/update-16-6-0/add-depends-on.d.ts +6 -0
- package/src/migrations/update-16-6-0/add-depends-on.js +43 -0
- package/src/migrations/update-16-6-0/update-metro-config.d.ts +6 -0
- package/src/migrations/update-16-6-0/update-metro-config.js +71 -0
- package/src/utils/get-cli-options.js +4 -1
- package/src/utils/pod-install-task.d.ts +10 -2
- package/src/utils/pod-install-task.js +12 -4
- package/src/utils/versions.d.ts +10 -9
- package/src/utils/versions.js +11 -10
- package/src/generators/application/files/app/.ruby-version +0 -1
- /package/src/generators/library/files/lib/{package.json__tmpl__ → package.json.template} +0 -0
- /package/src/generators/library/files/lib/src/{index.ts__tmpl__ → index.ts.template} +0 -0
- /package/src/generators/library/files/lib/{tsconfig.json__tmpl__ → tsconfig.json.template} +0 -0
- /package/src/generators/library/files/lib/{tsconfig.lib.json__tmpl__ → tsconfig.lib.json.template} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* This migration updates metro.config.js to export config as a default.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
function update(tree) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
14
|
+
for (const [_, config] of projects.entries()) {
|
|
15
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nx/react-native:start') {
|
|
16
|
+
if (tree.exists((0, path_1.join)(config.root, 'metro.config.js'))) {
|
|
17
|
+
const oldConfig = tree
|
|
18
|
+
.read((0, path_1.join)(config.root, 'metro.config.js'))
|
|
19
|
+
.toString();
|
|
20
|
+
tree.write((0, path_1.join)(config.root, 'metro-v71.config.js'), oldConfigComment + oldConfig);
|
|
21
|
+
tree.write((0, path_1.join)(config.root, 'metro.config.js'), content);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.default = update;
|
|
28
|
+
const oldConfigComment = `/**
|
|
29
|
+
* Old custom configuration for React Native v0.71.
|
|
30
|
+
* From @react-native/metro-config 0.72.1, it is no longer necessary to use a config function to access the complete default config.
|
|
31
|
+
* Please port your custom configuration to metro.config.js.
|
|
32
|
+
* Please see https://reactnative.dev/docs/metro to learn about configuration.
|
|
33
|
+
*/
|
|
34
|
+
`;
|
|
35
|
+
const content = `
|
|
36
|
+
const { withNxMetro } = require('@nx/react-native');
|
|
37
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
38
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
39
|
+
|
|
40
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
41
|
+
const { assetExts, sourceExts } = defaultConfig.resolver;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Metro configuration
|
|
45
|
+
* https://facebook.github.io/metro/docs/configuration
|
|
46
|
+
*
|
|
47
|
+
* @type {import('metro-config').MetroConfig}
|
|
48
|
+
*/
|
|
49
|
+
const customConfig = {
|
|
50
|
+
transformer: {
|
|
51
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
52
|
+
},
|
|
53
|
+
resolver: {
|
|
54
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
55
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
56
|
+
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
|
57
|
+
unstable_enableSymlinks: true,
|
|
58
|
+
unstable_enablePackageExports: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
|
|
63
|
+
// Change this to true to see debugging info.
|
|
64
|
+
// Useful if you have issues resolving modules
|
|
65
|
+
debug: false,
|
|
66
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
|
|
67
|
+
extensions: [],
|
|
68
|
+
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
|
|
69
|
+
watchFolders: [],
|
|
70
|
+
});
|
|
71
|
+
`;
|
|
@@ -16,7 +16,10 @@ function getCliOptions(options, optionKeysToIgnore = [], optionKeysInCamelName =
|
|
|
16
16
|
const cliKey = optionKeysInCamelName.includes(optionKey)
|
|
17
17
|
? (0, devkit_1.names)(optionKey).propertyName
|
|
18
18
|
: (0, devkit_1.names)(optionKey).fileName; // cli uses kebab case as default
|
|
19
|
-
if (
|
|
19
|
+
if (Array.isArray(optionValue)) {
|
|
20
|
+
acc.push(`--${cliKey}`, optionValue.join(','));
|
|
21
|
+
}
|
|
22
|
+
else if (typeof optionValue === 'boolean' && optionValue) {
|
|
20
23
|
// no need to pass in the value when it is true, just the flag name
|
|
21
24
|
acc.push(`--${cliKey}`);
|
|
22
25
|
}
|
|
@@ -4,5 +4,13 @@ import { GeneratorCallback } from '@nx/devkit';
|
|
|
4
4
|
* @param iosDirectory ios directory that contains Podfile
|
|
5
5
|
* @returns resolve with 0 if not error, reject with error otherwise
|
|
6
6
|
*/
|
|
7
|
-
export declare function runPodInstall(iosDirectory: string, install?: boolean,
|
|
8
|
-
|
|
7
|
+
export declare function runPodInstall(iosDirectory: string, install?: boolean, options?: {
|
|
8
|
+
buildFolder?: string;
|
|
9
|
+
repoUpdate?: boolean;
|
|
10
|
+
deployment?: boolean;
|
|
11
|
+
}): GeneratorCallback;
|
|
12
|
+
export declare function podInstall(iosDirectory: string, options?: {
|
|
13
|
+
buildFolder?: string;
|
|
14
|
+
repoUpdate?: boolean;
|
|
15
|
+
deployment?: boolean;
|
|
16
|
+
}): void;
|
|
@@ -22,7 +22,11 @@ ${chalk.bold('sudo xcode-select --switch /Applications/Xcode.app')}
|
|
|
22
22
|
* @param iosDirectory ios directory that contains Podfile
|
|
23
23
|
* @returns resolve with 0 if not error, reject with error otherwise
|
|
24
24
|
*/
|
|
25
|
-
function runPodInstall(iosDirectory, install = true,
|
|
25
|
+
function runPodInstall(iosDirectory, install = true, options = {
|
|
26
|
+
buildFolder: './build',
|
|
27
|
+
repoUpdate: false,
|
|
28
|
+
deployment: false,
|
|
29
|
+
}) {
|
|
26
30
|
return () => {
|
|
27
31
|
if ((0, os_1.platform)() !== 'darwin') {
|
|
28
32
|
devkit_1.logger.info('Skipping `pod install` on non-darwin platform');
|
|
@@ -33,13 +37,17 @@ function runPodInstall(iosDirectory, install = true, buildFolder) {
|
|
|
33
37
|
return;
|
|
34
38
|
}
|
|
35
39
|
devkit_1.logger.info(`Running \`pod install\` from "${iosDirectory}"`);
|
|
36
|
-
return podInstall(iosDirectory,
|
|
40
|
+
return podInstall(iosDirectory, options);
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
exports.runPodInstall = runPodInstall;
|
|
40
|
-
function podInstall(iosDirectory,
|
|
44
|
+
function podInstall(iosDirectory, options = {
|
|
45
|
+
buildFolder: './build',
|
|
46
|
+
repoUpdate: false,
|
|
47
|
+
deployment: false,
|
|
48
|
+
}) {
|
|
41
49
|
try {
|
|
42
|
-
(0, child_process_1.execSync)(
|
|
50
|
+
(0, child_process_1.execSync)(`pod install ${options.repoUpdate ? '--repo-update' : ''} ${options.deployment ? '--deployment' : ''}`, {
|
|
43
51
|
cwd: iosDirectory,
|
|
44
52
|
stdio: 'inherit',
|
|
45
53
|
});
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const reactNativeVersion = "0.
|
|
3
|
-
export declare const typesReactNativeVersion = "0.
|
|
2
|
+
export declare const reactNativeVersion = "0.72.3";
|
|
3
|
+
export declare const typesReactNativeVersion = "0.72.2";
|
|
4
4
|
export declare const typesNodeVersion = "18.14.4";
|
|
5
|
-
export declare const metroVersion = "0.
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
5
|
+
export declare const metroVersion = "0.76.7";
|
|
6
|
+
export declare const reactNativeMetroConfigVersion = "^0.72.9";
|
|
7
|
+
export declare const reactNativeCommunityCli = "11.3.5";
|
|
8
|
+
export declare const reactNativeCommunityCliIos = "11.3.5";
|
|
9
|
+
export declare const reactNativeCommunityCliAndroid = "11.3.5";
|
|
9
10
|
export declare const reactVersion = "18.2.0";
|
|
10
11
|
export declare const reactDomVersion = "18.2.0";
|
|
11
12
|
export declare const reactTestRendererVersion = "18.2.0";
|
|
@@ -15,6 +16,6 @@ export declare const testingLibraryJestNativeVersion = "5.4.2";
|
|
|
15
16
|
export declare const jestReactNativeVersion = "18.0.0";
|
|
16
17
|
export declare const reactNativeSvgTransformerVersion = "1.0.0";
|
|
17
18
|
export declare const reactNativeSvgVersion = "13.9.0";
|
|
18
|
-
export declare const babelRuntimeVersion = "7.
|
|
19
|
-
export declare const reactNativeAsyncStorageVersion = "1.
|
|
20
|
-
export declare const reactNativeSafeAreaContextVersion = "4.
|
|
19
|
+
export declare const babelRuntimeVersion = "7.22.6";
|
|
20
|
+
export declare const reactNativeAsyncStorageVersion = "1.19.0";
|
|
21
|
+
export declare const reactNativeSafeAreaContextVersion = "4.7.1";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reactNativeSafeAreaContextVersion = exports.reactNativeAsyncStorageVersion = exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
3
|
+
exports.reactNativeSafeAreaContextVersion = exports.reactNativeAsyncStorageVersion = exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.reactNativeMetroConfigVersion = exports.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.reactNativeVersion = '0.
|
|
6
|
-
exports.typesReactNativeVersion = '0.
|
|
5
|
+
exports.reactNativeVersion = '0.72.3';
|
|
6
|
+
exports.typesReactNativeVersion = '0.72.2';
|
|
7
7
|
exports.typesNodeVersion = '18.14.4';
|
|
8
|
-
exports.metroVersion = '0.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
8
|
+
exports.metroVersion = '0.76.7';
|
|
9
|
+
exports.reactNativeMetroConfigVersion = '^0.72.9';
|
|
10
|
+
exports.reactNativeCommunityCli = '11.3.5';
|
|
11
|
+
exports.reactNativeCommunityCliIos = '11.3.5';
|
|
12
|
+
exports.reactNativeCommunityCliAndroid = '11.3.5';
|
|
12
13
|
exports.reactVersion = '18.2.0';
|
|
13
14
|
exports.reactDomVersion = '18.2.0';
|
|
14
15
|
exports.reactTestRendererVersion = '18.2.0';
|
|
@@ -18,6 +19,6 @@ exports.testingLibraryJestNativeVersion = '5.4.2';
|
|
|
18
19
|
exports.jestReactNativeVersion = '18.0.0';
|
|
19
20
|
exports.reactNativeSvgTransformerVersion = '1.0.0';
|
|
20
21
|
exports.reactNativeSvgVersion = '13.9.0';
|
|
21
|
-
exports.babelRuntimeVersion = '7.
|
|
22
|
-
exports.reactNativeAsyncStorageVersion = '1.
|
|
23
|
-
exports.reactNativeSafeAreaContextVersion = '4.
|
|
22
|
+
exports.babelRuntimeVersion = '7.22.6';
|
|
23
|
+
exports.reactNativeAsyncStorageVersion = '1.19.0';
|
|
24
|
+
exports.reactNativeSafeAreaContextVersion = '4.7.1';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.7.6
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/generators/library/files/lib/{tsconfig.lib.json__tmpl__ → tsconfig.lib.json.template}
RENAMED
|
File without changes
|