@nx/react-native 0.0.0-pr-31222-862e973 → 0.0.0-pr-31313-387cdca
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 +4 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/generators.json +1 -1
- package/migrations.json +69 -335
- package/package.json +8 -10
- package/plugin.d.ts +1 -1
- package/plugin.js +2 -2
- package/plugins/metro-resolver.js +11 -11
- package/plugins/plugin.d.ts +2 -2
- package/plugins/plugin.js +57 -34
- package/project.json +2 -8
- package/src/executors/run-android/schema.json +1 -0
- package/src/executors/run-ios/schema.json +1 -0
- package/src/executors/start/lib/is-packager-running.js +1 -2
- package/src/executors/start/schema.json +1 -0
- package/src/executors/storybook/storybook.impl.js +3 -3
- package/src/executors/sync-deps/sync-deps.impl.js +4 -4
- package/src/generators/application/application.js +24 -4
- package/src/generators/application/files/app/.babelrc.js.template +1 -1
- package/src/generators/application/files/app/Gemfile.template +4 -4
- package/src/generators/application/files/app/android/app/build.gradle.template +9 -8
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +1 -0
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.kt.template +7 -6
- package/src/generators/application/files/app/android/build.gradle.template +4 -4
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/src/generators/application/files/app/android/gradle.properties +1 -3
- package/src/generators/application/files/app/android/gradlew.bat +94 -92
- package/src/generators/application/files/app/android/gradlew.template +5 -2
- package/src/generators/application/files/app/android/settings.gradle.template +3 -1
- package/src/generators/application/files/app/tsconfig.app.json.template +11 -1
- package/src/generators/application/files/app/tsconfig.json.template +2 -0
- package/src/generators/application/lib/add-e2e.js +2 -1
- package/src/generators/application/lib/add-project.js +26 -3
- package/src/generators/application/lib/normalize-options.d.ts +3 -1
- package/src/generators/application/lib/normalize-options.js +9 -5
- package/src/generators/application/schema.d.ts +6 -5
- package/src/generators/application/schema.json +20 -18
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +20 -29
- package/src/generators/component/files/js/__fileName__.__ext__ +28 -0
- package/src/generators/component/files/{__fileName__.tsx__tmpl__ → ts/__fileName__.__ext__} +6 -6
- package/src/generators/component/files/ts/__fileName__.spec.__ext__ +11 -0
- package/src/generators/component/lib/normalize-options.d.ts +6 -1
- package/src/generators/component/lib/normalize-options.js +13 -26
- package/src/generators/component/schema.d.ts +6 -14
- package/src/generators/component/schema.json +26 -40
- package/src/generators/convert-to-inferred/convert-to-inferred.js +1 -1
- package/src/generators/init/init.js +1 -1
- package/src/generators/library/files/lib/tsconfig.json.template +2 -0
- package/src/generators/library/files/lib/tsconfig.lib.json.template +11 -1
- package/src/generators/library/lib/normalize-options.d.ts +2 -0
- package/src/generators/library/lib/normalize-options.js +6 -3
- package/src/generators/library/library.js +119 -60
- package/src/generators/library/schema.d.ts +3 -5
- package/src/generators/library/schema.json +17 -21
- package/src/generators/storybook-configuration/schema.json +2 -1
- package/src/generators/web-configuration/files/base-vite/.babelrc.js.template +1 -1
- package/src/generators/web-configuration/files/base-vite/vite.config.ts__tmpl__ +4 -9
- package/src/generators/web-configuration/files/base-webpack/.babelrc.js.template +1 -1
- package/src/generators/web-configuration/files/base-webpack/webpack.config.js__tmpl__ +4 -0
- package/src/generators/web-configuration/schema.json +1 -1
- package/src/generators/web-configuration/web-configuration.js +7 -0
- package/src/utils/add-jest.d.ts +1 -1
- package/src/utils/add-jest.js +2 -1
- package/src/utils/add-linting.js +3 -2
- package/src/utils/ensure-dependencies.js +2 -0
- package/src/utils/pod-install-task.js +6 -6
- package/src/utils/testing-generators.js +2 -4
- package/src/utils/versions.d.ts +17 -13
- package/src/utils/versions.js +18 -14
- package/src/generators/library/files/lib/package.json.template +0 -4
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
- package/src/migrations/update-16-1-0/upgrade-storybook-6-5.d.ts +0 -6
- package/src/migrations/update-16-1-0/upgrade-storybook-6-5.js +0 -21
- package/src/migrations/update-16-6-0/add-depends-on.d.ts +0 -6
- package/src/migrations/update-16-6-0/add-depends-on.js +0 -63
- package/src/migrations/update-16-6-0/update-metro-config.d.ts +0 -6
- package/src/migrations/update-16-6-0/update-metro-config.js +0 -63
- package/src/migrations/update-16-9-0/remove-types-react-native.d.ts +0 -7
- package/src/migrations/update-16-9-0/remove-types-react-native.js +0 -13
- package/src/migrations/update-18-0-0/add-upgrade-target.d.ts +0 -6
- package/src/migrations/update-18-0-0/add-upgrade-target.js +0 -31
- package/src/migrations/update-18-0-0/add-web-configuration.d.ts +0 -8
- package/src/migrations/update-18-0-0/add-web-configuration.js +0 -33
- package/src/migrations/update-18-0-0/change-storybook-targets.d.ts +0 -5
- package/src/migrations/update-18-0-0/change-storybook-targets.js +0 -57
- package/src/migrations/update-18-0-0/remove-block-list.d.ts +0 -6
- package/src/migrations/update-18-0-0/remove-block-list.js +0 -28
- package/src/migrations/update-18-0-0/remove-metro.d.ts +0 -14
- package/src/migrations/update-18-0-0/remove-metro.js +0 -29
- package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +0 -6
- package/src/migrations/update-18-0-0/remove-symlink-target.js +0 -30
- package/src/utils/format-file.d.ts +0 -1
- package/src/utils/format-file.js +0 -15
- /package/src/generators/component/files/{__fileName__.spec.tsx__tmpl__ → js/__fileName__.spec.__ext__} +0 -0
|
@@ -12,38 +12,36 @@
|
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"properties": {
|
|
15
|
-
"
|
|
15
|
+
"directory": {
|
|
16
16
|
"type": "string",
|
|
17
|
-
"description": "
|
|
17
|
+
"description": "A directory where the lib is placed.",
|
|
18
|
+
"alias": "dir",
|
|
18
19
|
"$default": {
|
|
19
20
|
"$source": "argv",
|
|
20
21
|
"index": 0
|
|
21
22
|
},
|
|
22
|
-
"x-prompt": "
|
|
23
|
-
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
|
|
23
|
+
"x-prompt": "Which directory do you want to create the library in?"
|
|
24
24
|
},
|
|
25
|
-
"
|
|
25
|
+
"name": {
|
|
26
26
|
"type": "string",
|
|
27
|
-
"description": "
|
|
28
|
-
"
|
|
27
|
+
"description": "Library name.",
|
|
28
|
+
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$",
|
|
29
29
|
"x-priority": "important"
|
|
30
30
|
},
|
|
31
|
-
"projectNameAndRootFormat": {
|
|
32
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
33
|
-
"type": "string",
|
|
34
|
-
"enum": ["as-provided", "derived"]
|
|
35
|
-
},
|
|
36
31
|
"linter": {
|
|
37
32
|
"description": "The tool to use for running lint checks.",
|
|
38
33
|
"type": "string",
|
|
39
34
|
"enum": ["eslint", "none"],
|
|
40
|
-
"default": "
|
|
35
|
+
"default": "none",
|
|
36
|
+
"x-prompt": "Which linter would you like to use?",
|
|
37
|
+
"x-priority": "important"
|
|
41
38
|
},
|
|
42
39
|
"unitTestRunner": {
|
|
43
40
|
"type": "string",
|
|
44
41
|
"enum": ["jest", "none"],
|
|
45
42
|
"description": "Test runner to use for unit tests.",
|
|
46
|
-
"default": "
|
|
43
|
+
"default": "none",
|
|
44
|
+
"x-priority": "important"
|
|
47
45
|
},
|
|
48
46
|
"tags": {
|
|
49
47
|
"type": "string",
|
|
@@ -62,12 +60,6 @@
|
|
|
62
60
|
"description": "Do not update `tsconfig.json` for development experience.",
|
|
63
61
|
"x-priority": "internal"
|
|
64
62
|
},
|
|
65
|
-
"pascalCaseFiles": {
|
|
66
|
-
"type": "boolean",
|
|
67
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
68
|
-
"alias": "P",
|
|
69
|
-
"default": false
|
|
70
|
-
},
|
|
71
63
|
"publishable": {
|
|
72
64
|
"type": "boolean",
|
|
73
65
|
"description": "Create a publishable library."
|
|
@@ -101,7 +93,11 @@
|
|
|
101
93
|
"type": "boolean",
|
|
102
94
|
"default": false,
|
|
103
95
|
"x-priority": "internal"
|
|
96
|
+
},
|
|
97
|
+
"useProjectJson": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
104
100
|
}
|
|
105
101
|
},
|
|
106
|
-
"required": ["
|
|
102
|
+
"required": ["directory"]
|
|
107
103
|
}
|
|
@@ -30,27 +30,26 @@ const rollupPlugin = (matchers: RegExp[]) => ({
|
|
|
30
30
|
|
|
31
31
|
export default defineConfig({
|
|
32
32
|
root: __dirname,
|
|
33
|
-
cacheDir: '
|
|
33
|
+
cacheDir: '<%= offsetFromRoot %>node_modules/.vite/<%= projectRoot %>',
|
|
34
34
|
define: {
|
|
35
35
|
global: 'window',
|
|
36
36
|
},
|
|
37
|
-
|
|
38
37
|
resolve: {
|
|
39
38
|
extensions,
|
|
40
39
|
alias: {
|
|
41
40
|
'react-native': 'react-native-web',
|
|
41
|
+
'react-native-svg': 'react-native-svg-web',
|
|
42
|
+
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry/index',
|
|
42
43
|
},
|
|
43
44
|
},
|
|
44
|
-
|
|
45
45
|
build: {
|
|
46
46
|
reportCompressedSize: true,
|
|
47
47
|
commonjsOptions: { transformMixedEsModules: true },
|
|
48
|
-
outDir: '
|
|
48
|
+
outDir: '<%= offsetFromRoot %>dist/<%= projectRoot %>/web',
|
|
49
49
|
rollupOptions: {
|
|
50
50
|
plugins: [rollupPlugin([/react-native-vector-icons/])],
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
-
|
|
54
53
|
server: {
|
|
55
54
|
port: 4200,
|
|
56
55
|
host: 'localhost',
|
|
@@ -59,12 +58,10 @@ export default defineConfig({
|
|
|
59
58
|
allow: ['..'],
|
|
60
59
|
},
|
|
61
60
|
},
|
|
62
|
-
|
|
63
61
|
preview: {
|
|
64
62
|
port: 4300,
|
|
65
63
|
host: 'localhost',
|
|
66
64
|
},
|
|
67
|
-
|
|
68
65
|
optimizeDeps: {
|
|
69
66
|
esbuildOptions: {
|
|
70
67
|
resolveExtensions: extensions,
|
|
@@ -72,9 +69,7 @@ export default defineConfig({
|
|
|
72
69
|
loader: { '.js': 'jsx' },
|
|
73
70
|
},
|
|
74
71
|
},
|
|
75
|
-
|
|
76
72
|
plugins: [react(), nxViteTsPaths()],
|
|
77
|
-
|
|
78
73
|
// Uncomment this if you are using workers.
|
|
79
74
|
// worker: {
|
|
80
75
|
// plugins: [ nxViteTsPaths() ],
|
|
@@ -6,6 +6,8 @@ module.exports = {
|
|
|
6
6
|
resolve: {
|
|
7
7
|
alias: {
|
|
8
8
|
'react-native$': 'react-native-web',
|
|
9
|
+
'react-native-svg': 'react-native-svg-web',
|
|
10
|
+
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry/index',
|
|
9
11
|
},
|
|
10
12
|
extensions: ['.web.tsx', '.web.ts', '.web.jsx', '.web.js']
|
|
11
13
|
},
|
|
@@ -51,6 +53,8 @@ module.exports = composePlugins(
|
|
|
51
53
|
config.resolve.alias = {
|
|
52
54
|
...config.resolve.alias ?? {},
|
|
53
55
|
'react-native$': 'react-native-web',
|
|
56
|
+
'react-native-svg': 'react-native-svg-web',
|
|
57
|
+
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry/index',
|
|
54
58
|
};
|
|
55
59
|
config.resolve.extensions = [
|
|
56
60
|
'.web.tsx',
|
|
@@ -21,6 +21,7 @@ async function webConfigurationGenerator(tree, options) {
|
|
|
21
21
|
if (!options.skipPackageJson) {
|
|
22
22
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
23
23
|
'react-native-web': versions_1.reactNativeWebVersion,
|
|
24
|
+
'react-native-svg-web': versions_1.reacttNativeSvgWebVersion,
|
|
24
25
|
});
|
|
25
26
|
tasks.push(installTask);
|
|
26
27
|
}
|
|
@@ -40,6 +41,11 @@ async function webConfigurationGenerator(tree, options) {
|
|
|
40
41
|
: null,
|
|
41
42
|
});
|
|
42
43
|
}
|
|
44
|
+
if (!options.skipPackageJson) {
|
|
45
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
46
|
+
'@types/react-dom': versions_1.typesReactDomVersion,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
43
49
|
if (!options.skipFormat) {
|
|
44
50
|
await (0, devkit_1.formatFiles)(tree);
|
|
45
51
|
}
|
|
@@ -59,6 +65,7 @@ async function addBundlerConfiguration(tree, normalizedSchema) {
|
|
|
59
65
|
project: normalizedSchema.project,
|
|
60
66
|
newProject: true,
|
|
61
67
|
includeVitest: false,
|
|
68
|
+
projectType: 'application',
|
|
62
69
|
compiler: 'babel',
|
|
63
70
|
skipFormat: true,
|
|
64
71
|
});
|
package/src/utils/add-jest.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
export declare function addJest(host: Tree, unitTestRunner: 'jest' | 'none', projectName: string, appProjectRoot: string, js: boolean, skipPackageJson: boolean, addPlugin: boolean): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
2
|
+
export declare function addJest(host: Tree, unitTestRunner: 'jest' | 'none', projectName: string, appProjectRoot: string, js: boolean, skipPackageJson: boolean, addPlugin: boolean, runtimeTsconfigFileName: string): Promise<import("@nx/devkit").GeneratorCallback>;
|
package/src/utils/add-jest.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addJest = addJest;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const jest_1 = require("@nx/jest");
|
|
6
|
-
async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson, addPlugin) {
|
|
6
|
+
async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson, addPlugin, runtimeTsconfigFileName) {
|
|
7
7
|
if (unitTestRunner !== 'jest') {
|
|
8
8
|
return () => { };
|
|
9
9
|
}
|
|
@@ -17,6 +17,7 @@ async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, sk
|
|
|
17
17
|
skipPackageJson,
|
|
18
18
|
skipFormat: true,
|
|
19
19
|
addPlugin,
|
|
20
|
+
runtimeTsconfigFileName,
|
|
20
21
|
});
|
|
21
22
|
// overwrite the jest.config.ts file because react native needs to have special transform property
|
|
22
23
|
const configPath = `${appProjectRoot}/jest.config.${js ? 'js' : 'ts'}`;
|
package/src/utils/add-linting.js
CHANGED
|
@@ -7,7 +7,7 @@ const lint_1 = require("@nx/react/src/utils/lint");
|
|
|
7
7
|
const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
|
8
8
|
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
|
9
9
|
async function addLinting(host, options) {
|
|
10
|
-
if (options.linter ===
|
|
10
|
+
if (options.linter === 'none') {
|
|
11
11
|
return () => { };
|
|
12
12
|
}
|
|
13
13
|
const tasks = [];
|
|
@@ -17,6 +17,7 @@ async function addLinting(host, options) {
|
|
|
17
17
|
tsConfigPaths: options.tsConfigPaths,
|
|
18
18
|
skipFormat: true,
|
|
19
19
|
skipPackageJson: options.skipPackageJson,
|
|
20
|
+
setParserOptionsProject: options.setParserOptionsProject,
|
|
20
21
|
addPlugin: options.addPlugin,
|
|
21
22
|
});
|
|
22
23
|
tasks.push(lintTask);
|
|
@@ -43,7 +44,7 @@ async function addLinting(host, options) {
|
|
|
43
44
|
]);
|
|
44
45
|
}
|
|
45
46
|
if (!options.skipPackageJson) {
|
|
46
|
-
const installTask =
|
|
47
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
47
48
|
tasks.push(installTask);
|
|
48
49
|
}
|
|
49
50
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
@@ -13,7 +13,9 @@ function ensureDependencies(tree) {
|
|
|
13
13
|
'@react-native/metro-config': versions_2.reactNativeMetroConfigVersion,
|
|
14
14
|
'@testing-library/react-native': versions_2.testingLibraryReactNativeVersion,
|
|
15
15
|
'@testing-library/jest-native': versions_2.testingLibraryJestNativeVersion,
|
|
16
|
+
'@react-native-community/cli': versions_2.reactNativeCommunityCliVersion,
|
|
16
17
|
'@react-native-community/cli-platform-android': versions_2.reactNativeCommunityCliPlatformAndroidVersion,
|
|
18
|
+
'@react-native-community/cli-platform-ios': versions_2.reactNativeCommunityCliPlatformIosVersion,
|
|
17
19
|
'jest-react-native': versions_2.jestReactNativeVersion,
|
|
18
20
|
'react-test-renderer': versions_2.reactTestRendererVersion,
|
|
19
21
|
'react-native-svg-transformer': versions_2.reactNativeSvgTransformerVersion,
|
|
@@ -6,17 +6,17 @@ const child_process_1 = require("child_process");
|
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
7
7
|
const os_1 = require("os");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const
|
|
9
|
+
const pc = require("picocolors");
|
|
10
10
|
const devkit_1 = require("@nx/devkit");
|
|
11
11
|
const podInstallErrorMessage = `
|
|
12
|
-
Running ${
|
|
12
|
+
Running ${pc.bold('pod install')} failed, see above.
|
|
13
13
|
Do you have CocoaPods (https://cocoapods.org/) installed?
|
|
14
14
|
|
|
15
15
|
Check that your XCode path is correct:
|
|
16
|
-
${
|
|
16
|
+
${pc.bold('sudo xcode-select --print-path')}
|
|
17
17
|
|
|
18
18
|
If the path is wrong, switch the path: (your path may be different)
|
|
19
|
-
${
|
|
19
|
+
${pc.bold('sudo xcode-select --switch /Applications/Xcode.app')}
|
|
20
20
|
`;
|
|
21
21
|
/**
|
|
22
22
|
* Run pod install on ios directory
|
|
@@ -53,7 +53,7 @@ function podInstall(iosDirectory, options = {
|
|
|
53
53
|
(0, child_process_1.execSync)('touch .xcode.env', {
|
|
54
54
|
cwd: iosDirectory,
|
|
55
55
|
stdio: 'inherit',
|
|
56
|
-
windowsHide:
|
|
56
|
+
windowsHide: false,
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
const podCommand = [
|
|
@@ -64,7 +64,7 @@ function podInstall(iosDirectory, options = {
|
|
|
64
64
|
(0, child_process_1.execSync)(podCommand, {
|
|
65
65
|
cwd: iosDirectory,
|
|
66
66
|
stdio: 'inherit',
|
|
67
|
-
windowsHide:
|
|
67
|
+
windowsHide: false,
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
catch (e) {
|
|
@@ -4,17 +4,15 @@ exports.createApp = createApp;
|
|
|
4
4
|
exports.createLib = createLib;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const application_1 = require("../generators/application/application");
|
|
7
|
-
const eslint_1 = require("@nx/eslint");
|
|
8
7
|
async function createApp(tree, appName) {
|
|
9
8
|
await (0, application_1.default)(tree, {
|
|
10
|
-
linter:
|
|
9
|
+
linter: 'eslint',
|
|
11
10
|
skipFormat: true,
|
|
12
11
|
style: 'css',
|
|
13
12
|
unitTestRunner: 'none',
|
|
14
|
-
|
|
13
|
+
directory: appName,
|
|
15
14
|
e2eTestRunner: 'none',
|
|
16
15
|
install: false,
|
|
17
|
-
projectNameAndRootFormat: 'as-provided',
|
|
18
16
|
bundler: 'webpack',
|
|
19
17
|
});
|
|
20
18
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const reactNativeVersion = "0.
|
|
2
|
+
export declare const reactNativeVersion = "~0.76.3";
|
|
3
3
|
export declare const typesNodeVersion = "18.16.9";
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
4
|
+
export declare const reactNativeCommunityCliVersion = "~15.0.1";
|
|
5
|
+
export declare const reactNativeCommunityCliPlatformAndroidVersion = "~15.0.1";
|
|
6
|
+
export declare const reactNativeCommunityCliPlatformIosVersion = "~15.0.1";
|
|
7
|
+
export declare const reactNativeBabelPresetVersion = "~0.76.3";
|
|
8
|
+
export declare const reactNativeMetroConfigVersion = "~0.76.3";
|
|
9
|
+
export declare const reactNativeWebVersion = "~0.19.13";
|
|
10
|
+
export declare const reactVersion = "~18.3.1";
|
|
11
|
+
export declare const reactDomVersion = "~18.3.1";
|
|
12
|
+
export declare const reactTestRendererVersion = "~18.3.1";
|
|
13
|
+
export declare const typesReactVersion = "~18.3.12";
|
|
14
|
+
export declare const typesReactDomVersion = "~18.3.1";
|
|
15
|
+
export declare const testingLibraryReactNativeVersion = "~12.9.0";
|
|
13
16
|
export declare const testingLibraryJestNativeVersion = "~5.4.3";
|
|
14
17
|
export declare const jestReactNativeVersion = "18.0.0";
|
|
15
|
-
export declare const reactNativeSvgTransformerVersion = "1.
|
|
16
|
-
export declare const reactNativeSvgVersion = "15.
|
|
17
|
-
export declare const
|
|
18
|
+
export declare const reactNativeSvgTransformerVersion = "~1.5.0";
|
|
19
|
+
export declare const reactNativeSvgVersion = "~15.8.0";
|
|
20
|
+
export declare const reacttNativeSvgWebVersion = "~1.0.9";
|
|
21
|
+
export declare const babelRuntimeVersion = "~7.26.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.typesNodeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
3
|
+
exports.babelRuntimeVersion = exports.reacttNativeSvgWebVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeCommunityCliPlatformIosVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.reactNativeCommunityCliVersion = exports.typesNodeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.reactNativeVersion = '0.
|
|
5
|
+
exports.reactNativeVersion = '~0.76.3';
|
|
6
6
|
exports.typesNodeVersion = '18.16.9';
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
7
|
+
exports.reactNativeCommunityCliVersion = '~15.0.1';
|
|
8
|
+
exports.reactNativeCommunityCliPlatformAndroidVersion = '~15.0.1';
|
|
9
|
+
exports.reactNativeCommunityCliPlatformIosVersion = '~15.0.1';
|
|
10
|
+
exports.reactNativeBabelPresetVersion = '~0.76.3';
|
|
11
|
+
exports.reactNativeMetroConfigVersion = '~0.76.3';
|
|
12
|
+
exports.reactNativeWebVersion = '~0.19.13';
|
|
13
|
+
exports.reactVersion = '~18.3.1';
|
|
14
|
+
exports.reactDomVersion = '~18.3.1';
|
|
15
|
+
exports.reactTestRendererVersion = '~18.3.1';
|
|
16
|
+
exports.typesReactVersion = '~18.3.12';
|
|
17
|
+
exports.typesReactDomVersion = '~18.3.1';
|
|
18
|
+
exports.testingLibraryReactNativeVersion = '~12.9.0';
|
|
16
19
|
exports.testingLibraryJestNativeVersion = '~5.4.3';
|
|
17
20
|
exports.jestReactNativeVersion = '18.0.0';
|
|
18
|
-
exports.reactNativeSvgTransformerVersion = '1.
|
|
19
|
-
exports.reactNativeSvgVersion = '15.
|
|
20
|
-
exports.
|
|
21
|
+
exports.reactNativeSvgTransformerVersion = '~1.5.0';
|
|
22
|
+
exports.reactNativeSvgVersion = '~15.8.0';
|
|
23
|
+
exports.reacttNativeSvgWebVersion = '~1.0.9';
|
|
24
|
+
exports.babelRuntimeVersion = '~7.26.0';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = replacePackage;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
6
|
-
async function replacePackage(tree) {
|
|
7
|
-
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/react-native', '@nx/react-native');
|
|
8
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = update;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
/**
|
|
6
|
-
* This migration is to upgrade storybook to 6.5.
|
|
7
|
-
* - remove react-native-storybook-loader
|
|
8
|
-
*/
|
|
9
|
-
function update(tree) {
|
|
10
|
-
if (tree.exists('package.json')) {
|
|
11
|
-
(0, devkit_1.updateJson)(tree, 'package.json', (packageJson) => {
|
|
12
|
-
if (packageJson.dependencies?.['react-native-storybook-loader']) {
|
|
13
|
-
delete packageJson.dependencies['react-native-storybook-loader'];
|
|
14
|
-
}
|
|
15
|
-
if (packageJson.devDependencies?.['react-native-storybook-loader']) {
|
|
16
|
-
delete packageJson.devDependencies['react-native-storybook-loader'];
|
|
17
|
-
}
|
|
18
|
-
return packageJson;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = update;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
/**
|
|
6
|
-
* This migration adds dependsOn to project.json.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
async function update(tree) {
|
|
10
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
-
for (const [name, config] of projects.entries()) {
|
|
12
|
-
if (config.targets?.['start']?.executor === '@nx/react-native:start') {
|
|
13
|
-
config.targets['start'].dependsOn = [
|
|
14
|
-
'ensure-symlink',
|
|
15
|
-
'sync-deps',
|
|
16
|
-
'pod-install',
|
|
17
|
-
];
|
|
18
|
-
if (config.targets?.['run-ios']?.executor === '@nx/react-native:run-ios') {
|
|
19
|
-
config.targets['run-ios'].dependsOn = [
|
|
20
|
-
'ensure-symlink',
|
|
21
|
-
'sync-deps',
|
|
22
|
-
'pod-install',
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
if (config.targets?.['bundle-ios']?.executor === '@nx/react-native:bundle') {
|
|
26
|
-
config.targets['bundle-ios'].dependsOn = ['ensure-symlink'];
|
|
27
|
-
}
|
|
28
|
-
if (config.targets?.['run-android']?.executor ===
|
|
29
|
-
'@nx/react-native:run-android') {
|
|
30
|
-
config.targets['run-android'].dependsOn ??= [
|
|
31
|
-
'ensure-symlink',
|
|
32
|
-
'sync-deps',
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
if (config.targets?.['build-android']?.executor ===
|
|
36
|
-
'@nx/react-native:build-android') {
|
|
37
|
-
config.targets['build-android'].dependsOn = [
|
|
38
|
-
'ensure-symlink',
|
|
39
|
-
'sync-deps',
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
if (config.targets?.['build-ios']?.executor === '@nx/react-native:build-ios') {
|
|
43
|
-
config.targets['build-ios'].dependsOn ??= [
|
|
44
|
-
'ensure-symlink',
|
|
45
|
-
'sync-deps',
|
|
46
|
-
'pod-install',
|
|
47
|
-
];
|
|
48
|
-
}
|
|
49
|
-
if (config.targets?.['pod-instal']?.executor ===
|
|
50
|
-
'@nx/react-native:pod-install') {
|
|
51
|
-
config.targets['pod-install'].dependsOn ??= [
|
|
52
|
-
'ensure-symlink',
|
|
53
|
-
'sync-deps',
|
|
54
|
-
];
|
|
55
|
-
}
|
|
56
|
-
if (config.targets?.['bundle-android']?.executor ===
|
|
57
|
-
'@nx/react-native:bundle') {
|
|
58
|
-
config.targets['bundle-android'].dependsOn ??= ['ensure-symlink'];
|
|
59
|
-
}
|
|
60
|
-
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = update;
|
|
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
|
-
async function update(tree) {
|
|
11
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
-
for (const [_, config] of projects.entries()) {
|
|
13
|
-
if (config.targets?.['start']?.executor === '@nx/react-native:start') {
|
|
14
|
-
if (tree.exists((0, path_1.join)(config.root, 'metro.config.js'))) {
|
|
15
|
-
const oldConfig = tree
|
|
16
|
-
.read((0, path_1.join)(config.root, 'metro.config.js'))
|
|
17
|
-
.toString();
|
|
18
|
-
tree.write((0, path_1.join)(config.root, 'metro-v71.config.js'), oldConfigComment + oldConfig);
|
|
19
|
-
tree.write((0, path_1.join)(config.root, 'metro.config.js'), content);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const oldConfigComment = `/**
|
|
25
|
-
* Old custom configuration for React Native v0.71.
|
|
26
|
-
* From @react-native/metro-config 0.72.1, it is no longer necessary to use a config function to access the complete default config.
|
|
27
|
-
* Please port your custom configuration to metro.config.js.
|
|
28
|
-
* Please see https://reactnative.dev/docs/metro to learn about configuration.
|
|
29
|
-
*/
|
|
30
|
-
`;
|
|
31
|
-
const content = `
|
|
32
|
-
const { withNxMetro } = require('@nx/react-native');
|
|
33
|
-
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
34
|
-
|
|
35
|
-
const defaultConfig = getDefaultConfig(__dirname);
|
|
36
|
-
const { assetExts, sourceExts } = defaultConfig.resolver;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Metro configuration
|
|
40
|
-
* https://facebook.github.io/metro/docs/configuration
|
|
41
|
-
*
|
|
42
|
-
* @type {import('metro-config').MetroConfig}
|
|
43
|
-
*/
|
|
44
|
-
const customConfig = {
|
|
45
|
-
transformer: {
|
|
46
|
-
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
47
|
-
},
|
|
48
|
-
resolver: {
|
|
49
|
-
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
50
|
-
sourceExts: [...sourceExts, 'cjs', 'mjs', 'svg'],
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
|
|
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', 'json'
|
|
59
|
-
extensions: [],
|
|
60
|
-
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
|
|
61
|
-
watchFolders: [],
|
|
62
|
-
});
|
|
63
|
-
`;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = update;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
/**
|
|
6
|
-
* Remove @types/react-native package since it is no longer required. It would be a part of react native package.
|
|
7
|
-
* @param tree
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
async function update(tree) {
|
|
11
|
-
(0, devkit_1.removeDependenciesFromPackageJson)(tree, [], ['@types/react-native']);
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|