@nx/react-native 0.0.0-pr-28808-eac89e6 → 0.0.0-pr-29122-4727ac1
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 +7 -7
- package/src/generators/application/schema.json +2 -2
- package/src/generators/component/schema.json +11 -8
- package/src/generators/library/lib/normalize-options.d.ts +1 -0
- package/src/generators/library/lib/normalize-options.js +2 -0
- package/src/generators/library/library.js +12 -1
- package/src/generators/library/schema.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react-native",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-29122-4727ac1",
|
|
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": [
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"node-fetch": "^2.6.7",
|
|
37
37
|
"tsconfig-paths": "^4.1.2",
|
|
38
38
|
"tslib": "^2.3.0",
|
|
39
|
-
"@nx/devkit": "0.0.0-pr-
|
|
40
|
-
"@nx/jest": "0.0.0-pr-
|
|
41
|
-
"@nx/js": "0.0.0-pr-
|
|
42
|
-
"@nx/eslint": "0.0.0-pr-
|
|
43
|
-
"@nx/react": "0.0.0-pr-
|
|
44
|
-
"@nx/workspace": "0.0.0-pr-
|
|
39
|
+
"@nx/devkit": "0.0.0-pr-29122-4727ac1",
|
|
40
|
+
"@nx/jest": "0.0.0-pr-29122-4727ac1",
|
|
41
|
+
"@nx/js": "0.0.0-pr-29122-4727ac1",
|
|
42
|
+
"@nx/eslint": "0.0.0-pr-29122-4727ac1",
|
|
43
|
+
"@nx/react": "0.0.0-pr-29122-4727ac1",
|
|
44
|
+
"@nx/workspace": "0.0.0-pr-29122-4727ac1"
|
|
45
45
|
},
|
|
46
46
|
"executors": "./executors.json",
|
|
47
47
|
"ng-update": {
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"description": "The tool to use for running lint checks.",
|
|
45
45
|
"type": "string",
|
|
46
46
|
"enum": ["eslint", "none"],
|
|
47
|
-
"default": "
|
|
47
|
+
"default": "none",
|
|
48
48
|
"x-priority": "important"
|
|
49
49
|
},
|
|
50
50
|
"unitTestRunner": {
|
|
51
51
|
"type": "string",
|
|
52
52
|
"enum": ["jest", "none"],
|
|
53
53
|
"description": "Test runner to use for unit tests",
|
|
54
|
-
"default": "
|
|
54
|
+
"default": "none",
|
|
55
55
|
"x-priority": "important"
|
|
56
56
|
},
|
|
57
57
|
"tags": {
|
|
@@ -7,28 +7,31 @@
|
|
|
7
7
|
"type": "object",
|
|
8
8
|
"examples": [
|
|
9
9
|
{
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"description": "Generate a component with the exported symbol matching the file name. It results in the component `Foo` at `mylib/src/lib/foo.tsx`",
|
|
11
|
+
"command": "nx g @nx/react-native:component mylib/src/lib/foo"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"description": "Generate a component with the exported symbol different from the file name. It results in the component `Custom` at `mylib/src/lib/foo.tsx`",
|
|
15
|
+
"command": "nx g @nx/react-native:component mylib/src/lib/foo --name=custom"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"description": "Generate a class component at `mylib/src/lib/foo.tsx`",
|
|
19
|
+
"command": "nx g @nx/react-native:component mylib/src/lib/foo --classComponent"
|
|
16
20
|
}
|
|
17
21
|
],
|
|
18
22
|
"properties": {
|
|
19
23
|
"path": {
|
|
20
24
|
"type": "string",
|
|
21
|
-
"description": "The path
|
|
25
|
+
"description": "The file path to the component without the file extension. Relative to the current working directory.",
|
|
22
26
|
"$default": {
|
|
23
27
|
"$source": "argv",
|
|
24
28
|
"index": 0
|
|
25
29
|
},
|
|
26
|
-
"x-prompt": "What
|
|
30
|
+
"x-prompt": "What is the component file path?"
|
|
27
31
|
},
|
|
28
32
|
"name": {
|
|
29
33
|
"type": "string",
|
|
30
|
-
"description": "The name of the
|
|
31
|
-
"x-prompt": "What name would you like to use for the component?"
|
|
34
|
+
"description": "The component symbol name. Defaults to the last segment of the file path."
|
|
32
35
|
},
|
|
33
36
|
"js": {
|
|
34
37
|
"type": "boolean",
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
6
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
7
|
async function normalizeOptions(host, options) {
|
|
7
8
|
await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'library');
|
|
8
9
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -26,6 +27,7 @@ async function normalizeOptions(host, options) {
|
|
|
26
27
|
projectRoot,
|
|
27
28
|
parsedTags,
|
|
28
29
|
importPath,
|
|
30
|
+
isUsingTsSolutionConfig: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host),
|
|
29
31
|
};
|
|
30
32
|
return normalized;
|
|
31
33
|
}
|
|
@@ -68,6 +68,10 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
|
68
68
|
if (!options.skipFormat) {
|
|
69
69
|
await (0, devkit_1.formatFiles)(host);
|
|
70
70
|
}
|
|
71
|
+
// Always run install to link packages.
|
|
72
|
+
if (options.isUsingTsSolutionConfig) {
|
|
73
|
+
tasks.push(() => (0, devkit_1.installPackagesTask)(host));
|
|
74
|
+
}
|
|
71
75
|
tasks.push(() => {
|
|
72
76
|
(0, log_show_project_command_1.logShowProjectCommand)(options.name);
|
|
73
77
|
});
|
|
@@ -81,10 +85,17 @@ async function addProject(host, options) {
|
|
|
81
85
|
tags: options.parsedTags,
|
|
82
86
|
targets: {},
|
|
83
87
|
};
|
|
84
|
-
if (
|
|
88
|
+
if (options.isUsingTsSolutionConfig) {
|
|
89
|
+
const sourceEntry = !options.buildable
|
|
90
|
+
? options.js
|
|
91
|
+
? './src/index.js'
|
|
92
|
+
: './src/index.ts'
|
|
93
|
+
: undefined;
|
|
85
94
|
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
|
|
86
95
|
name: (0, get_import_path_1.getImportPath)(host, options.name),
|
|
87
96
|
version: '0.0.1',
|
|
97
|
+
main: sourceEntry,
|
|
98
|
+
types: sourceEntry,
|
|
88
99
|
nx: {
|
|
89
100
|
name: options.name,
|
|
90
101
|
sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"description": "The tool to use for running lint checks.",
|
|
33
33
|
"type": "string",
|
|
34
34
|
"enum": ["eslint", "none"],
|
|
35
|
-
"default": "
|
|
35
|
+
"default": "none",
|
|
36
36
|
"x-prompt": "Which linter would you like to use?",
|
|
37
37
|
"x-priority": "important"
|
|
38
38
|
},
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"type": "string",
|
|
41
41
|
"enum": ["jest", "none"],
|
|
42
42
|
"description": "Test runner to use for unit tests.",
|
|
43
|
-
"default": "
|
|
43
|
+
"default": "none",
|
|
44
44
|
"x-priority": "important"
|
|
45
45
|
},
|
|
46
46
|
"tags": {
|