@nx/react 22.7.0-beta.7 → 22.7.0-beta.9

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.
@@ -1,42 +1,42 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactComponentStory",
5
- "title": "Create component story",
6
- "description": "Generate storybook story for a react component.",
7
- "type": "object",
8
- "properties": {
9
- "project": {
10
- "type": "string",
11
- "aliases": ["name", "projectName"],
12
- "description": "The project where to add the components.",
13
- "examples": ["shared-ui-component"],
14
- "$default": {
15
- "$source": "projectName",
16
- "index": 0
17
- },
18
- "x-prompt": "What's name of the project where the component lives?",
19
- "x-priority": "important"
2
+ "$schema": "https://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxReactComponentStory",
5
+ "title": "Create component story",
6
+ "description": "Generate storybook story for a react component.",
7
+ "type": "object",
8
+ "properties": {
9
+ "project": {
10
+ "type": "string",
11
+ "aliases": ["name", "projectName"],
12
+ "description": "The project where to add the components.",
13
+ "examples": ["shared-ui-component"],
14
+ "$default": {
15
+ "$source": "projectName",
16
+ "index": 0
17
+ },
18
+ "x-prompt": "What's name of the project where the component lives?",
19
+ "x-priority": "important"
20
+ },
21
+ "componentPath": {
22
+ "type": "string",
23
+ "description": "Relative path to the component file from the library root.",
24
+ "examples": ["lib/components"],
25
+ "x-prompt": "What's path of the component relative to the project's lib root?",
26
+ "x-priority": "important"
27
+ },
28
+ "skipFormat": {
29
+ "description": "Skip formatting files.",
30
+ "type": "boolean",
31
+ "default": false,
32
+ "x-priority": "internal"
33
+ },
34
+ "interactionTests": {
35
+ "type": "boolean",
36
+ "description": "Set up Storybook interaction tests.",
37
+ "default": true,
38
+ "x-priority": "important"
39
+ }
20
40
  },
21
- "componentPath": {
22
- "type": "string",
23
- "description": "Relative path to the component file from the library root.",
24
- "examples": ["lib/components"],
25
- "x-prompt": "What's path of the component relative to the project's lib root?",
26
- "x-priority": "important"
27
- },
28
- "skipFormat": {
29
- "description": "Skip formatting files.",
30
- "type": "boolean",
31
- "default": false,
32
- "x-priority": "internal"
33
- },
34
- "interactionTests": {
35
- "type": "boolean",
36
- "description": "Set up Storybook interaction tests.",
37
- "default": true,
38
- "x-priority": "important"
39
- }
40
- },
41
- "required": ["project", "componentPath"]
41
+ "required": ["project", "componentPath"]
42
42
  }
@@ -1,31 +1,31 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactCypressComponentTest",
5
- "title": "Add Cypress component test",
6
- "description": "Add a Cypress component test for a component.",
7
- "type": "object",
8
- "examples": [
9
- {
10
- "command": "nx g @nx/react:component-test --project=my-react-project --component-path=src/lib/fancy-component.tsx",
11
- "description": "Create a cypress component test for FancyComponent"
12
- }
13
- ],
14
- "properties": {
15
- "project": {
16
- "type": "string",
17
- "description": "The name of the project the component is apart of",
18
- "x-dropdown": "projects",
19
- "x-prompt": "What project is this component apart of?",
20
- "x-priority": "important"
2
+ "$schema": "https://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxReactCypressComponentTest",
5
+ "title": "Add Cypress component test",
6
+ "description": "Add a Cypress component test for a component.",
7
+ "type": "object",
8
+ "examples": [
9
+ {
10
+ "command": "nx g @nx/react:component-test --project=my-react-project --component-path=src/lib/fancy-component.tsx",
11
+ "description": "Create a cypress component test for FancyComponent"
12
+ }
13
+ ],
14
+ "properties": {
15
+ "project": {
16
+ "type": "string",
17
+ "description": "The name of the project the component is apart of",
18
+ "x-dropdown": "projects",
19
+ "x-prompt": "What project is this component apart of?",
20
+ "x-priority": "important"
21
+ },
22
+ "componentPath": {
23
+ "type": "string",
24
+ "description": "Path to component, from the project source root",
25
+ "x-prompt": "What is the path to the component?",
26
+ "x-priority": "important"
27
+ }
21
28
  },
22
- "componentPath": {
23
- "type": "string",
24
- "description": "Path to component, from the project source root",
25
- "x-prompt": "What is the path to the component?",
26
- "x-priority": "important"
27
- }
28
- },
29
- "required": ["project", "componentPath"],
30
- "examplesFile": "../../../docs/component-test-examples.md"
29
+ "required": ["project", "componentPath"],
30
+ "examplesFile": "../../../docs/component-test-examples.md"
31
31
  }
@@ -1,54 +1,54 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactCypressComponentTestConfiguration",
5
- "title": "Add Cypress component testing",
6
- "description": "Add a Cypress component testing configuration to an existing project.",
7
- "type": "object",
8
- "examples": [
9
- {
10
- "command": "nx g @nx/react:cypress-component-configuration --project=my-react-project",
11
- "description": "Add component testing to your react project"
2
+ "$schema": "https://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxReactCypressComponentTestConfiguration",
5
+ "title": "Add Cypress component testing",
6
+ "description": "Add a Cypress component testing configuration to an existing project.",
7
+ "type": "object",
8
+ "examples": [
9
+ {
10
+ "command": "nx g @nx/react:cypress-component-configuration --project=my-react-project",
11
+ "description": "Add component testing to your react project"
12
+ },
13
+ {
14
+ "command": "nx g @nx/react:cypress-component-configuration --project=my-react-project --generate-tests",
15
+ "description": "Add component testing to your react project and generate component tests for your existing components"
16
+ }
17
+ ],
18
+ "properties": {
19
+ "project": {
20
+ "type": "string",
21
+ "description": "The name of the project to add cypress component testing configuration to",
22
+ "x-dropdown": "projects",
23
+ "x-prompt": "What project should we add Cypress component testing to?",
24
+ "x-priority": "important"
25
+ },
26
+ "generateTests": {
27
+ "type": "boolean",
28
+ "description": "Generate default component tests for existing components in the project",
29
+ "x-prompt": "Automatically generate tests for components declared in this project?",
30
+ "default": false,
31
+ "x-priority": "important"
32
+ },
33
+ "buildTarget": {
34
+ "type": "string",
35
+ "description": "A build target used to configure Cypress component testing in the format of `project:target[:configuration]`. The build target should be from a React app. If not provided we will try to infer it from your projects usage.",
36
+ "pattern": "^[^:\\s]+:[^:\\s]+(:\\S+)?$"
37
+ },
38
+ "skipFormat": {
39
+ "type": "boolean",
40
+ "description": "Skip formatting files",
41
+ "default": false,
42
+ "x-priority": "internal"
43
+ },
44
+ "bundler": {
45
+ "description": "The bundler to use for Cypress Component Testing.",
46
+ "type": "string",
47
+ "enum": ["vite", "webpack"],
48
+ "hidden": true,
49
+ "x-priority": "internal"
50
+ }
12
51
  },
13
- {
14
- "command": "nx g @nx/react:cypress-component-configuration --project=my-react-project --generate-tests",
15
- "description": "Add component testing to your react project and generate component tests for your existing components"
16
- }
17
- ],
18
- "properties": {
19
- "project": {
20
- "type": "string",
21
- "description": "The name of the project to add cypress component testing configuration to",
22
- "x-dropdown": "projects",
23
- "x-prompt": "What project should we add Cypress component testing to?",
24
- "x-priority": "important"
25
- },
26
- "generateTests": {
27
- "type": "boolean",
28
- "description": "Generate default component tests for existing components in the project",
29
- "x-prompt": "Automatically generate tests for components declared in this project?",
30
- "default": false,
31
- "x-priority": "important"
32
- },
33
- "buildTarget": {
34
- "type": "string",
35
- "description": "A build target used to configure Cypress component testing in the format of `project:target[:configuration]`. The build target should be from a React app. If not provided we will try to infer it from your projects usage.",
36
- "pattern": "^[^:\\s]+:[^:\\s]+(:\\S+)?$"
37
- },
38
- "skipFormat": {
39
- "type": "boolean",
40
- "description": "Skip formatting files",
41
- "default": false,
42
- "x-priority": "internal"
43
- },
44
- "bundler": {
45
- "description": "The bundler to use for Cypress Component Testing.",
46
- "type": "string",
47
- "enum": ["vite", "webpack"],
48
- "hidden": true,
49
- "x-priority": "internal"
50
- }
51
- },
52
- "required": ["project"],
53
- "examplesFile": "../../../docs/cypress-component-configuration-examples.md"
52
+ "required": ["project"],
53
+ "examplesFile": "../../../docs/cypress-component-configuration-examples.md"
54
54
  }
@@ -1,90 +1,90 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactFederateModule",
5
- "title": "Federate Module",
6
- "description": "Create a federated module, which can be loaded by a Consumer (host) via a Producer (remote).",
7
- "examples": [
8
- {
9
- "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemote --remoteDirectory=apps/myRemote",
10
- "description": "Create a federated module from myRemote, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
2
+ "$schema": "https://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxReactFederateModule",
5
+ "title": "Federate Module",
6
+ "description": "Create a federated module, which can be loaded by a Consumer (host) via a Producer (remote).",
7
+ "examples": [
8
+ {
9
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemote --remoteDirectory=apps/myRemote",
10
+ "description": "Create a federated module from myRemote, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
11
+ },
12
+ {
13
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
14
+ "description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
15
+ }
16
+ ],
17
+ "type": "object",
18
+ "properties": {
19
+ "path": {
20
+ "type": "string",
21
+ "$default": {
22
+ "$source": "argv",
23
+ "index": 0
24
+ },
25
+ "description": "The path to locate the federated module. This path should be relative to the workspace root and the file should exist.",
26
+ "x-prompt": "What is the path to the module to be federated?"
27
+ },
28
+ "name": {
29
+ "description": "The name of the module.",
30
+ "type": "string",
31
+ "x-prompt": "What name would you like to use for the module?",
32
+ "pattern": "^[a-zA-Z][^:]*$",
33
+ "x-priority": "important"
34
+ },
35
+ "remote": {
36
+ "type": "string",
37
+ "description": "The name of the Producer (remote).",
38
+ "x-prompt": "What is/should the Producer (remote) be named?",
39
+ "alias": "producer"
40
+ },
41
+ "remoteDirectory": {
42
+ "description": "The directory of the new Producer (remote) application if one needs to be created.",
43
+ "type": "string",
44
+ "alias": "producerDirectory"
45
+ },
46
+ "style": {
47
+ "description": "The file extension to be used for style files.",
48
+ "type": "string",
49
+ "default": "none",
50
+ "alias": "s"
51
+ },
52
+ "linter": {
53
+ "description": "The tool to use for running lint checks.",
54
+ "type": "string",
55
+ "enum": ["eslint"],
56
+ "default": "eslint"
57
+ },
58
+ "skipFormat": {
59
+ "description": "Skip formatting files.",
60
+ "type": "boolean",
61
+ "default": false,
62
+ "x-priority": "internal"
63
+ },
64
+ "unitTestRunner": {
65
+ "type": "string",
66
+ "enum": ["jest", "none"],
67
+ "description": "Test runner to use for unit tests.",
68
+ "default": "jest"
69
+ },
70
+ "e2eTestRunner": {
71
+ "type": "string",
72
+ "enum": ["cypress", "playwright", "none"],
73
+ "description": "Test runner to use for end to end (E2E) tests.",
74
+ "x-prompt": "Which E2E test runner would you like to use?",
75
+ "default": "cypress"
76
+ },
77
+ "host": {
78
+ "type": "string",
79
+ "description": "The Consumer (host) application for this Producer (remote)."
80
+ },
81
+ "bundler": {
82
+ "description": "The bundler to use.",
83
+ "type": "string",
84
+ "enum": ["rspack", "webpack"],
85
+ "default": "rspack"
86
+ }
11
87
  },
12
- {
13
- "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
14
- "description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
15
- }
16
- ],
17
- "type": "object",
18
- "properties": {
19
- "path": {
20
- "type": "string",
21
- "$default": {
22
- "$source": "argv",
23
- "index": 0
24
- },
25
- "description": "The path to locate the federated module. This path should be relative to the workspace root and the file should exist.",
26
- "x-prompt": "What is the path to the module to be federated?"
27
- },
28
- "name": {
29
- "description": "The name of the module.",
30
- "type": "string",
31
- "x-prompt": "What name would you like to use for the module?",
32
- "pattern": "^[a-zA-Z][^:]*$",
33
- "x-priority": "important"
34
- },
35
- "remote": {
36
- "type": "string",
37
- "description": "The name of the Producer (remote).",
38
- "x-prompt": "What is/should the Producer (remote) be named?",
39
- "alias": "producer"
40
- },
41
- "remoteDirectory": {
42
- "description": "The directory of the new Producer (remote) application if one needs to be created.",
43
- "type": "string",
44
- "alias": "producerDirectory"
45
- },
46
- "style": {
47
- "description": "The file extension to be used for style files.",
48
- "type": "string",
49
- "default": "none",
50
- "alias": "s"
51
- },
52
- "linter": {
53
- "description": "The tool to use for running lint checks.",
54
- "type": "string",
55
- "enum": ["eslint"],
56
- "default": "eslint"
57
- },
58
- "skipFormat": {
59
- "description": "Skip formatting files.",
60
- "type": "boolean",
61
- "default": false,
62
- "x-priority": "internal"
63
- },
64
- "unitTestRunner": {
65
- "type": "string",
66
- "enum": ["jest", "none"],
67
- "description": "Test runner to use for unit tests.",
68
- "default": "jest"
69
- },
70
- "e2eTestRunner": {
71
- "type": "string",
72
- "enum": ["cypress", "playwright", "none"],
73
- "description": "Test runner to use for end to end (E2E) tests.",
74
- "x-prompt": "Which E2E test runner would you like to use?",
75
- "default": "cypress"
76
- },
77
- "host": {
78
- "type": "string",
79
- "description": "The Consumer (host) application for this Producer (remote)."
80
- },
81
- "bundler": {
82
- "description": "The bundler to use.",
83
- "type": "string",
84
- "enum": ["rspack", "webpack"],
85
- "default": "rspack"
86
- }
87
- },
88
- "required": ["name", "path", "remote"],
89
- "additionalProperties": false
88
+ "required": ["name", "path", "remote"],
89
+ "additionalProperties": false
90
90
  }
@@ -1,57 +1,57 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactHook",
5
- "title": "Create a React Hook for Nx",
6
- "description": "Create a React component using Hooks in a dedicated React project.",
7
- "type": "object",
8
- "examples": [
9
- {
10
- "description": "Generate a hook with the exported symbol matching the file name. It results in the hook `useFoo` at `mylib/src/lib/foo.ts`",
11
- "command": "nx g @nx/react:hook mylib/src/lib/foo.ts"
2
+ "$schema": "https://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxReactHook",
5
+ "title": "Create a React Hook for Nx",
6
+ "description": "Create a React component using Hooks in a dedicated React project.",
7
+ "type": "object",
8
+ "examples": [
9
+ {
10
+ "description": "Generate a hook with the exported symbol matching the file name. It results in the hook `useFoo` at `mylib/src/lib/foo.ts`",
11
+ "command": "nx g @nx/react:hook mylib/src/lib/foo.ts"
12
+ },
13
+ {
14
+ "description": "Generate a hook with the exported symbol different from the file name. It results in the hook `useCustom` at `mylib/src/lib/foo.ts`",
15
+ "command": "nx g @nx/react:hook mylib/src/lib/foo.ts --name=useCustom"
16
+ },
17
+ {
18
+ "description": "Generate a hook without providing the file extension. It results in the hook `useFoo` at `mylib/src/lib/foo.ts`",
19
+ "command": "nx g @nx/react:hook mylib/src/lib/foo"
20
+ }
21
+ ],
22
+ "properties": {
23
+ "path": {
24
+ "type": "string",
25
+ "description": "The file path to the hook. Relative to the current working directory.",
26
+ "$default": {
27
+ "$source": "argv",
28
+ "index": 0
29
+ },
30
+ "x-prompt": "What is the hook file path?",
31
+ "x-priority": "important"
32
+ },
33
+ "name": {
34
+ "type": "string",
35
+ "description": "The hook symbol name. Defaults to the last segment of the file path."
36
+ },
37
+ "js": {
38
+ "type": "boolean",
39
+ "description": "Generate JavaScript files rather than TypeScript files.",
40
+ "x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
41
+ },
42
+ "skipTests": {
43
+ "type": "boolean",
44
+ "description": "When true, does not create `spec.ts` test files for the new hook.",
45
+ "default": false,
46
+ "x-priority": "internal"
47
+ },
48
+ "export": {
49
+ "type": "boolean",
50
+ "description": "When true, the hook is exported from the project `index.ts` (if it exists).",
51
+ "alias": "e",
52
+ "default": false,
53
+ "x-prompt": "Should this hook be exported in the project?"
54
+ }
12
55
  },
13
- {
14
- "description": "Generate a hook with the exported symbol different from the file name. It results in the hook `useCustom` at `mylib/src/lib/foo.ts`",
15
- "command": "nx g @nx/react:hook mylib/src/lib/foo.ts --name=useCustom"
16
- },
17
- {
18
- "description": "Generate a hook without providing the file extension. It results in the hook `useFoo` at `mylib/src/lib/foo.ts`",
19
- "command": "nx g @nx/react:hook mylib/src/lib/foo"
20
- }
21
- ],
22
- "properties": {
23
- "path": {
24
- "type": "string",
25
- "description": "The file path to the hook. Relative to the current working directory.",
26
- "$default": {
27
- "$source": "argv",
28
- "index": 0
29
- },
30
- "x-prompt": "What is the hook file path?",
31
- "x-priority": "important"
32
- },
33
- "name": {
34
- "type": "string",
35
- "description": "The hook symbol name. Defaults to the last segment of the file path."
36
- },
37
- "js": {
38
- "type": "boolean",
39
- "description": "Generate JavaScript files rather than TypeScript files.",
40
- "x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
41
- },
42
- "skipTests": {
43
- "type": "boolean",
44
- "description": "When true, does not create `spec.ts` test files for the new hook.",
45
- "default": false,
46
- "x-priority": "internal"
47
- },
48
- "export": {
49
- "type": "boolean",
50
- "description": "When true, the hook is exported from the project `index.ts` (if it exists).",
51
- "alias": "e",
52
- "default": false,
53
- "x-prompt": "Should this hook be exported in the project?"
54
- }
55
- },
56
- "required": ["path"]
56
+ "required": ["path"]
57
57
  }