@nx/react-native 23.0.0-beta.11 → 23.0.0-beta.13
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/package.json +8 -8
- package/plugins/metro-resolver.js +2 -2
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +5 -6
- package/src/generators/application/lib/normalize-options.js +2 -2
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +3 -4
- package/src/generators/component/lib/add-import.js +2 -2
- package/src/generators/component/lib/normalize-options.js +2 -2
- package/src/generators/library/lib/normalize-options.js +2 -2
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +8 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react-native",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"type": "commonjs",
|
|
28
28
|
"types": "index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nx/devkit": "23.0.0-beta.
|
|
31
|
-
"@nx/js": "23.0.0-beta.
|
|
32
|
-
"@nx/eslint": "23.0.0-beta.
|
|
33
|
-
"@nx/react": "23.0.0-beta.
|
|
30
|
+
"@nx/devkit": "23.0.0-beta.13",
|
|
31
|
+
"@nx/js": "23.0.0-beta.13",
|
|
32
|
+
"@nx/eslint": "23.0.0-beta.13",
|
|
33
|
+
"@nx/react": "23.0.0-beta.13",
|
|
34
34
|
"ajv": "^8.0.0",
|
|
35
35
|
"enhanced-resolve": "^5.8.3",
|
|
36
36
|
"ignore": "^7.0.5",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"metro-resolver": ">= 0.82.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"nx": "23.0.0-beta.
|
|
47
|
+
"nx": "23.0.0-beta.13"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@nx/detox": "23.0.0-beta.
|
|
51
|
-
"@nx/rollup": "23.0.0-beta.
|
|
50
|
+
"@nx/detox": "23.0.0-beta.13",
|
|
51
|
+
"@nx/rollup": "23.0.0-beta.13"
|
|
52
52
|
},
|
|
53
53
|
"executors": "./executors.json",
|
|
54
54
|
"ng-update": {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getResolveRequest = getResolveRequest;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const tsconfig_paths_1 = require("tsconfig-paths");
|
|
6
|
-
const
|
|
6
|
+
const js_1 = require("@nx/js");
|
|
7
7
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
8
8
|
const enhanced_resolve_1 = require("enhanced-resolve");
|
|
9
9
|
const path_1 = require("path");
|
|
@@ -115,7 +115,7 @@ function getMatcher(debug) {
|
|
|
115
115
|
if (!matcher) {
|
|
116
116
|
const result = (0, tsconfig_paths_1.loadConfig)();
|
|
117
117
|
if (result.resultType === 'success') {
|
|
118
|
-
absoluteBaseUrl = (0,
|
|
118
|
+
absoluteBaseUrl = (0, js_1.resolvePathsBaseUrl)(result.configFileAbsolutePath);
|
|
119
119
|
paths = result.paths;
|
|
120
120
|
if (debug) {
|
|
121
121
|
console.log(pc.cyan(`[Nx] Located tsconfig at ${pc.bold(absoluteBaseUrl)}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/application/application.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/application/application.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAUlC,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAkG5B;AA4CD,eAAe,+BAA+B,CAAC"}
|
|
@@ -18,8 +18,7 @@ const create_application_files_1 = require("./lib/create-application-files");
|
|
|
18
18
|
const add_e2e_1 = require("./lib/add-e2e");
|
|
19
19
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
20
20
|
const sync_deps_impl_1 = require("../../executors/sync-deps/sync-deps.impl");
|
|
21
|
-
const
|
|
22
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
21
|
+
const internal_2 = require("@nx/js/internal");
|
|
23
22
|
async function reactNativeApplicationGenerator(host, schema) {
|
|
24
23
|
return await reactNativeApplicationGeneratorInternal(host, {
|
|
25
24
|
addPlugin: false,
|
|
@@ -29,7 +28,7 @@ async function reactNativeApplicationGenerator(host, schema) {
|
|
|
29
28
|
}
|
|
30
29
|
async function reactNativeApplicationGeneratorInternal(host, schema) {
|
|
31
30
|
const tasks = [];
|
|
32
|
-
const addTsPlugin = (0,
|
|
31
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
|
|
33
32
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
34
33
|
...schema,
|
|
35
34
|
skipFormat: true,
|
|
@@ -49,7 +48,7 @@ async function reactNativeApplicationGeneratorInternal(host, schema) {
|
|
|
49
48
|
// If we are using the new TS solution
|
|
50
49
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
51
50
|
if (options.isTsSolutionSetup) {
|
|
52
|
-
await (0,
|
|
51
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
|
|
53
52
|
}
|
|
54
53
|
const lintTask = await (0, add_linting_1.addLinting)(host, {
|
|
55
54
|
...options,
|
|
@@ -73,7 +72,7 @@ async function reactNativeApplicationGeneratorInternal(host, schema) {
|
|
|
73
72
|
tasks.push(chmodTaskGradlewTask);
|
|
74
73
|
tasks.push(addSyncDepsTask(host, options));
|
|
75
74
|
tasks.push(addPodInstallTask(host, options));
|
|
76
|
-
(0,
|
|
75
|
+
(0, internal_2.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.app.json', {
|
|
77
76
|
jsx: 'react-jsx',
|
|
78
77
|
module: 'esnext',
|
|
79
78
|
moduleResolution: 'bundler',
|
|
@@ -82,7 +81,7 @@ async function reactNativeApplicationGeneratorInternal(host, schema) {
|
|
|
82
81
|
}, options.linter === 'eslint'
|
|
83
82
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
84
83
|
: undefined);
|
|
85
|
-
(0,
|
|
84
|
+
(0, internal_2.sortPackageJsonFields)(host, options.appProjectRoot);
|
|
86
85
|
if (!options.skipFormat) {
|
|
87
86
|
await (0, devkit_1.formatFiles)(host);
|
|
88
87
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
9
|
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -19,7 +19,7 @@ async function normalizeOptions(host, options) {
|
|
|
19
19
|
const iosProjectRoot = (0, devkit_1.joinPathFragments)(appProjectRoot, 'ios');
|
|
20
20
|
const androidProjectRoot = (0, devkit_1.joinPathFragments)(appProjectRoot, 'android');
|
|
21
21
|
const rootProject = appProjectRoot === '.';
|
|
22
|
-
const isTsSolutionSetup = (0,
|
|
22
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
23
23
|
const appProjectName = !isTsSolutionSetup || options.name ? projectName : importPath;
|
|
24
24
|
const e2eProjectName = rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
25
25
|
const e2eProjectRoot = rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/component/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/component/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AAKpB,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,iBAUf;AAwED,eAAe,6BAA6B,CAAC"}
|
|
@@ -4,9 +4,8 @@ exports.reactNativeComponentGenerator = reactNativeComponentGenerator;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
6
6
|
const add_import_1 = require("./lib/add-import");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
10
9
|
async function reactNativeComponentGenerator(host, schema) {
|
|
11
10
|
const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
12
11
|
createComponentFiles(host, options);
|
|
@@ -27,11 +26,11 @@ function createComponentFiles(host, options) {
|
|
|
27
26
|
let tsModule;
|
|
28
27
|
function addExportsToBarrel(host, options) {
|
|
29
28
|
if (!tsModule) {
|
|
30
|
-
tsModule = (0,
|
|
29
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
31
30
|
}
|
|
32
31
|
const workspace = (0, devkit_1.getProjects)(host);
|
|
33
32
|
const proj = workspace.get(options.projectName);
|
|
34
|
-
const isApp = (0,
|
|
33
|
+
const isApp = (0, internal_1.getProjectType)(host, proj.root, proj.projectType) === 'application';
|
|
35
34
|
if (options.export && !isApp) {
|
|
36
35
|
const indexFilePath = (0, devkit_1.joinPathFragments)(...(options.projectSourceRoot
|
|
37
36
|
? [options.projectSourceRoot]
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addImport = addImport;
|
|
4
4
|
const js_1 = require("@nx/js");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
let tsModule;
|
|
8
8
|
function addImport(source, statement) {
|
|
9
9
|
if (!tsModule) {
|
|
10
|
-
tsModule = (0,
|
|
10
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
11
11
|
}
|
|
12
12
|
const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
|
|
13
13
|
if (allImports.length > 0) {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
const { artifactName: name, directory, fileName, filePath, fileExtension, fileExtensionType, project: projectName, } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
9
9
|
path: options.path,
|
|
@@ -15,7 +15,7 @@ async function normalizeOptions(host, options) {
|
|
|
15
15
|
const { className } = (0, devkit_1.names)(name);
|
|
16
16
|
const { root, sourceRoot: projectSourceRoot, projectType } = project;
|
|
17
17
|
if (options.export &&
|
|
18
|
-
(0,
|
|
18
|
+
(0, internal_2.getProjectType)(host, root, projectType) === 'application') {
|
|
19
19
|
devkit_1.logger.warn(`The "--export" option should not be used with applications and will do nothing.`);
|
|
20
20
|
}
|
|
21
21
|
options.classComponent = options.classComponent ?? false;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
9
9
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -19,7 +19,7 @@ async function normalizeOptions(host, options) {
|
|
|
19
19
|
const parsedTags = options.tags
|
|
20
20
|
? options.tags.split(',').map((s) => s.trim())
|
|
21
21
|
: [];
|
|
22
|
-
const isUsingTsSolutionConfig = (0,
|
|
22
|
+
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
23
23
|
const normalized = {
|
|
24
24
|
...options,
|
|
25
25
|
fileName: projectName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/library/library.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EASjB,IAAI,EAIL,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/library/library.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EASjB,IAAI,EAIL,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAelC,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,mCAAmC,CACvD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAkH5B;AAyKD,eAAe,2BAA2B,CAAC"}
|
|
@@ -12,12 +12,10 @@ const add_jest_1 = require("../../utils/add-jest");
|
|
|
12
12
|
const component_1 = tslib_1.__importDefault(require("../component/component"));
|
|
13
13
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
14
14
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
15
|
-
const
|
|
16
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
15
|
+
const internal_2 = require("@nx/js/internal");
|
|
17
16
|
const add_rollup_build_target_1 = require("@nx/react/src/generators/library/lib/add-rollup-build-target");
|
|
18
17
|
const path_1 = require("path");
|
|
19
18
|
const versions_1 = require("../../utils/versions");
|
|
20
|
-
const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
|
|
21
19
|
async function reactNativeLibraryGenerator(host, schema) {
|
|
22
20
|
return await reactNativeLibraryGeneratorInternal(host, {
|
|
23
21
|
addPlugin: false,
|
|
@@ -27,7 +25,7 @@ async function reactNativeLibraryGenerator(host, schema) {
|
|
|
27
25
|
}
|
|
28
26
|
async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
29
27
|
const tasks = [];
|
|
30
|
-
const addTsPlugin = (0,
|
|
28
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
|
|
31
29
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
32
30
|
...schema,
|
|
33
31
|
addTsPlugin,
|
|
@@ -45,7 +43,7 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
|
45
43
|
}
|
|
46
44
|
createFiles(host, options);
|
|
47
45
|
if (options.isUsingTsSolutionConfig) {
|
|
48
|
-
await (0,
|
|
46
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
|
|
49
47
|
}
|
|
50
48
|
const addProjectTask = await addProject(host, options);
|
|
51
49
|
if (addProjectTask) {
|
|
@@ -71,21 +69,21 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
|
71
69
|
});
|
|
72
70
|
tasks.push(() => componentTask);
|
|
73
71
|
if (options.publishable) {
|
|
74
|
-
tasks.push(await (0,
|
|
72
|
+
tasks.push(await (0, internal_2.releaseTasks)(host));
|
|
75
73
|
}
|
|
76
74
|
if (!options.skipTsConfig && !options.isUsingTsSolutionConfig) {
|
|
77
75
|
(0, js_1.addTsConfigPath)(host, options.importPath, [
|
|
78
76
|
(0, devkit_1.joinPathFragments)(options.projectRoot, './src', 'index.' + (options.js ? 'js' : 'ts')),
|
|
79
77
|
]);
|
|
80
78
|
}
|
|
81
|
-
(0,
|
|
79
|
+
(0, internal_2.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
|
|
82
80
|
jsx: 'react-jsx',
|
|
83
81
|
module: 'esnext',
|
|
84
82
|
moduleResolution: 'bundler',
|
|
85
83
|
}, options.linter === 'eslint'
|
|
86
84
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
87
85
|
: undefined);
|
|
88
|
-
(0,
|
|
86
|
+
(0, internal_2.sortPackageJsonFields)(host, options.projectRoot);
|
|
89
87
|
if (!options.skipFormat) {
|
|
90
88
|
await (0, devkit_1.formatFiles)(host);
|
|
91
89
|
}
|
|
@@ -133,7 +131,7 @@ async function addProject(host, options) {
|
|
|
133
131
|
else {
|
|
134
132
|
if (options.publishable) {
|
|
135
133
|
const nxJson = (0, devkit_1.readJson)(host, 'nx.json');
|
|
136
|
-
await (0,
|
|
134
|
+
await (0, internal_2.addReleaseConfigForNonTsSolution)(host, options.name, project);
|
|
137
135
|
}
|
|
138
136
|
(0, devkit_1.addProjectConfiguration)(host, options.name, project);
|
|
139
137
|
}
|
|
@@ -143,7 +141,7 @@ async function addProject(host, options) {
|
|
|
143
141
|
options.buildable) {
|
|
144
142
|
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), packageJson);
|
|
145
143
|
if (options.publishable) {
|
|
146
|
-
await (0,
|
|
144
|
+
await (0, internal_2.addReleaseConfigForTsSolution)(host, options.name, project);
|
|
147
145
|
(0, devkit_1.updateProjectConfiguration)(host, options.name, project);
|
|
148
146
|
}
|
|
149
147
|
}
|