@nx/react-native 19.9.0-canary.20240921-a510b36 → 20.0.0-beta.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/generators.json +1 -1
- package/package.json +8 -8
- package/src/generators/application/application.js +0 -1
- package/src/generators/application/lib/normalize-options.js +0 -1
- package/src/generators/application/schema.d.ts +0 -1
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +0 -7
- package/src/generators/component/lib/normalize-options.js +0 -6
- package/src/generators/component/schema.d.ts +3 -13
- package/src/generators/component/schema.json +2 -24
- package/src/generators/library/lib/normalize-options.js +0 -1
- package/src/generators/library/library.js +0 -1
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +0 -6
package/generators.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"description": "Create a React Native library."
|
|
25
25
|
},
|
|
26
26
|
"component": {
|
|
27
|
-
"factory": "./src/generators/component/component
|
|
27
|
+
"factory": "./src/generators/component/component",
|
|
28
28
|
"schema": "./src/generators/component/schema.json",
|
|
29
29
|
"description": "Create a React Native component.",
|
|
30
30
|
"aliases": ["c"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0-beta.0",
|
|
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": [
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"node-fetch": "^2.6.7",
|
|
38
38
|
"tsconfig-paths": "^4.1.2",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/devkit": "
|
|
41
|
-
"@nx/jest": "
|
|
42
|
-
"@nx/js": "
|
|
43
|
-
"@nx/eslint": "
|
|
44
|
-
"@nx/react": "
|
|
45
|
-
"@nx/workspace": "
|
|
46
|
-
"@nrwl/react-native": "
|
|
40
|
+
"@nx/devkit": "20.0.0-beta.0",
|
|
41
|
+
"@nx/jest": "20.0.0-beta.0",
|
|
42
|
+
"@nx/js": "20.0.0-beta.0",
|
|
43
|
+
"@nx/eslint": "20.0.0-beta.0",
|
|
44
|
+
"@nx/react": "20.0.0-beta.0",
|
|
45
|
+
"@nx/workspace": "20.0.0-beta.0",
|
|
46
|
+
"@nrwl/react-native": "20.0.0-beta.0"
|
|
47
47
|
},
|
|
48
48
|
"executors": "./executors.json",
|
|
49
49
|
"ng-update": {
|
|
@@ -20,7 +20,6 @@ const sync_deps_impl_1 = require("../../executors/sync-deps/sync-deps.impl");
|
|
|
20
20
|
async function reactNativeApplicationGenerator(host, schema) {
|
|
21
21
|
return await reactNativeApplicationGeneratorInternal(host, {
|
|
22
22
|
addPlugin: false,
|
|
23
|
-
projectNameAndRootFormat: 'derived',
|
|
24
23
|
...schema,
|
|
25
24
|
});
|
|
26
25
|
}
|
|
@@ -9,7 +9,6 @@ async function normalizeOptions(host, options) {
|
|
|
9
9
|
projectType: 'application',
|
|
10
10
|
directory: options.directory,
|
|
11
11
|
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
12
|
-
callingGenerator: '@nx/react-native:application',
|
|
13
12
|
});
|
|
14
13
|
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
15
14
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
@@ -10,7 +10,6 @@ export interface Schema {
|
|
|
10
10
|
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
11
11
|
tags?: string;
|
|
12
12
|
unitTestRunner: 'jest' | 'none'; // default is jest
|
|
13
|
-
pascalCaseFiles?: boolean;
|
|
14
13
|
classComponent?: boolean;
|
|
15
14
|
js?: boolean;
|
|
16
15
|
linter: Linter | LinterType;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Schema } from './schema';
|
|
2
2
|
import { Tree } from '@nx/devkit';
|
|
3
3
|
export declare function reactNativeComponentGenerator(host: Tree, schema: Schema): Promise<void>;
|
|
4
|
-
export declare function reactNativeComponentGeneratorInternal(host: Tree, schema: Schema): Promise<void>;
|
|
5
4
|
export default reactNativeComponentGenerator;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.reactNativeComponentGenerator = reactNativeComponentGenerator;
|
|
4
|
-
exports.reactNativeComponentGeneratorInternal = reactNativeComponentGeneratorInternal;
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
7
6
|
const add_import_1 = require("./lib/add-import");
|
|
8
7
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
9
8
|
const path_1 = require("path");
|
|
10
9
|
async function reactNativeComponentGenerator(host, schema) {
|
|
11
|
-
return reactNativeComponentGeneratorInternal(host, {
|
|
12
|
-
nameAndDirectoryFormat: 'derived',
|
|
13
|
-
...schema,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async function reactNativeComponentGeneratorInternal(host, schema) {
|
|
17
10
|
const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
18
11
|
createComponentFiles(host, options);
|
|
19
12
|
addExportsToBarrel(host, options);
|
|
@@ -6,16 +6,10 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
|
|
|
6
6
|
async function normalizeOptions(host, options) {
|
|
7
7
|
assertValidOptions(options);
|
|
8
8
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
9
|
-
artifactType: 'component',
|
|
10
|
-
callingGenerator: '@nx/react-native:component',
|
|
11
9
|
name: options.name,
|
|
12
10
|
directory: options.directory,
|
|
13
|
-
derivedDirectory: options.directory,
|
|
14
|
-
flat: options.flat,
|
|
15
11
|
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
16
|
-
project: options.project,
|
|
17
12
|
fileExtension: 'tsx',
|
|
18
|
-
pascalCaseFile: options.pascalCaseFiles,
|
|
19
13
|
});
|
|
20
14
|
const project = (0, devkit_1.getProjects)(host).get(projectName);
|
|
21
15
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
+
import type { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Same as the @nx/react library schema, except it removes keys: style, routing, globalCss
|
|
3
5
|
*/
|
|
4
6
|
export interface Schema {
|
|
5
7
|
name: string;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
8
|
-
*/
|
|
9
|
-
project: string;
|
|
10
8
|
skipTests?: boolean;
|
|
11
9
|
directory?: string;
|
|
12
10
|
export?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. This option will be removed in Nx v19.
|
|
15
|
-
*/
|
|
16
|
-
pascalCaseFiles?: boolean;
|
|
17
11
|
classComponent?: boolean;
|
|
18
12
|
js?: boolean;
|
|
19
|
-
|
|
20
|
-
* @deprecated Provide the `name` in pascal-case and use the `as-provided` format. This option will be removed in Nx v19.
|
|
21
|
-
*/
|
|
22
|
-
flat?: boolean;
|
|
23
|
-
nameAndDirectoryFormat?: 'as-provided' | 'derived';
|
|
13
|
+
nameAndDirectoryFormat?: NameAndDirectoryFormat;
|
|
24
14
|
}
|
|
@@ -7,24 +7,15 @@
|
|
|
7
7
|
"type": "object",
|
|
8
8
|
"examples": [
|
|
9
9
|
{
|
|
10
|
-
"command": "nx g @nx/react-native:component my-component --
|
|
10
|
+
"command": "nx g @nx/react-native:component my-component --directory=mylib/src/lib/my-component",
|
|
11
11
|
"description": "Generate a component in the `mylib` library"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"command": "nx g @nx/react-native:component my-component --
|
|
14
|
+
"command": "nx g @nx/react-native:component my-component --directory=mylib/src/lib/my-component --classComponent",
|
|
15
15
|
"description": "Generate a class component in the `mylib` library"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"properties": {
|
|
19
|
-
"project": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The name of the project.",
|
|
22
|
-
"alias": "p",
|
|
23
|
-
"$default": {
|
|
24
|
-
"$source": "projectName"
|
|
25
|
-
},
|
|
26
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
|
|
27
|
-
},
|
|
28
19
|
"name": {
|
|
29
20
|
"type": "string",
|
|
30
21
|
"description": "The name of the component.",
|
|
@@ -54,12 +45,6 @@
|
|
|
54
45
|
"type": "string",
|
|
55
46
|
"enum": ["as-provided", "derived"]
|
|
56
47
|
},
|
|
57
|
-
"flat": {
|
|
58
|
-
"type": "boolean",
|
|
59
|
-
"description": "Create component at the source root rather than its own directory.",
|
|
60
|
-
"default": false,
|
|
61
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. This option will be removed in Nx v19."
|
|
62
|
-
},
|
|
63
48
|
"export": {
|
|
64
49
|
"type": "boolean",
|
|
65
50
|
"description": "When true, the component is exported from the project `index.ts` (if it exists).",
|
|
@@ -67,13 +52,6 @@
|
|
|
67
52
|
"default": false,
|
|
68
53
|
"x-prompt": "Should this component be exported in the project?"
|
|
69
54
|
},
|
|
70
|
-
"pascalCaseFiles": {
|
|
71
|
-
"type": "boolean",
|
|
72
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
73
|
-
"alias": "P",
|
|
74
|
-
"default": false,
|
|
75
|
-
"x-deprecated": "Provide the `name` in pascal-case and use the `as-provided` format. This option will be removed in Nx v19."
|
|
76
|
-
},
|
|
77
55
|
"classComponent": {
|
|
78
56
|
"type": "boolean",
|
|
79
57
|
"alias": "C",
|
|
@@ -10,7 +10,6 @@ async function normalizeOptions(host, options) {
|
|
|
10
10
|
directory: options.directory,
|
|
11
11
|
importPath: options.importPath,
|
|
12
12
|
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
13
|
-
callingGenerator: '@nx/react-native:library',
|
|
14
13
|
});
|
|
15
14
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
16
15
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
@@ -14,7 +14,6 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
|
|
|
14
14
|
async function reactNativeLibraryGenerator(host, schema) {
|
|
15
15
|
return await reactNativeLibraryGeneratorInternal(host, {
|
|
16
16
|
addPlugin: false,
|
|
17
|
-
projectNameAndRootFormat: 'derived',
|
|
18
17
|
...schema,
|
|
19
18
|
});
|
|
20
19
|
}
|
|
@@ -62,12 +62,6 @@
|
|
|
62
62
|
"description": "Do not update `tsconfig.json` for development experience.",
|
|
63
63
|
"x-priority": "internal"
|
|
64
64
|
},
|
|
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
65
|
"publishable": {
|
|
72
66
|
"type": "boolean",
|
|
73
67
|
"description": "Create a publishable library."
|