@nx/expo 20.1.3 → 20.1.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/expo",
3
- "version": "20.1.3",
3
+ "version": "20.1.4",
4
4
  "private": false,
5
5
  "description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
6
6
  "keywords": [
@@ -28,13 +28,13 @@
28
28
  "main": "./index",
29
29
  "types": "index.d.ts",
30
30
  "dependencies": {
31
- "@nx/devkit": "20.1.3",
32
- "@nx/eslint": "20.1.3",
33
- "@nx/jest": "20.1.3",
34
- "@nx/js": "20.1.3",
35
- "@nx/react": "20.1.3",
36
- "@nx/web": "20.1.3",
37
- "@nx/webpack": "20.1.3",
31
+ "@nx/devkit": "20.1.4",
32
+ "@nx/eslint": "20.1.4",
33
+ "@nx/jest": "20.1.4",
34
+ "@nx/js": "20.1.4",
35
+ "@nx/react": "20.1.4",
36
+ "@nx/web": "20.1.4",
37
+ "@nx/webpack": "20.1.4",
38
38
  "enhanced-resolve": "^5.8.3",
39
39
  "metro-config": "~0.80.4",
40
40
  "metro-resolver": "~0.80.4",
@@ -5,11 +5,11 @@
5
5
  "description": "Create an Expo Application for Nx.",
6
6
  "examples": [
7
7
  {
8
- "command": "g @nx/expo:app myapp --directory=nested",
8
+ "command": "nx g @nx/expo:app myapp --directory=nested",
9
9
  "description": "Generate apps/nested/myapp"
10
10
  },
11
11
  {
12
- "command": "g @nx/expo:app myapp --classComponent",
12
+ "command": "nx g @nx/expo:app myapp --classComponent",
13
13
  "description": "Use class components instead of functional components"
14
14
  }
15
15
  ],
@@ -4,7 +4,6 @@ exports.normalizeOptions = normalizeOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
6
6
  async function normalizeOptions(host, options) {
7
- assertValidOptions(options);
8
7
  const { artifactName: name, fileName, filePath, directory, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, {
9
8
  name: options.name,
10
9
  path: options.path,
@@ -19,6 +18,7 @@ async function normalizeOptions(host, options) {
19
18
  options.classComponent = options.classComponent ?? false;
20
19
  return {
21
20
  ...options,
21
+ name,
22
22
  directory,
23
23
  className,
24
24
  fileName,
@@ -27,16 +27,3 @@ async function normalizeOptions(host, options) {
27
27
  projectName,
28
28
  };
29
29
  }
30
- function assertValidOptions(options) {
31
- const slashes = ['/', '\\'];
32
- slashes.forEach((s) => {
33
- if (options.name.indexOf(s) !== -1) {
34
- const [name, ...rest] = options.name.split(s).reverse();
35
- let suggestion = rest.map((x) => x.toLowerCase()).join(s);
36
- if (options.path) {
37
- suggestion = `${options.path}${s}${suggestion}`;
38
- }
39
- throw new Error(`Found "${s}" in the component name. Did you mean to use the --directory option (e.g. \`nx g c ${name} --directory ${suggestion}\`)?`);
40
- }
41
- });
42
- }
@@ -9,5 +9,4 @@ export interface Schema {
9
9
  export: boolean; // default is false
10
10
  classComponent: boolean; // default is false
11
11
  js: boolean; // default is false
12
- nameAndDirectoryFormat?: NameAndDirectoryFormat;
13
12
  }
@@ -6,29 +6,31 @@
6
6
  "type": "object",
7
7
  "examples": [
8
8
  {
9
- "command": "g @nx/expo:component mylib/my-component --name my-component",
10
- "description": "Generate a component in the mylib library"
9
+ "description": "Generate a component with the exported symbol matching the file name. It results in the component `Foo` at `mylib/src/foo.tsx`",
10
+ "command": "nx g @nx/expo:component mylib/src/foo"
11
11
  },
12
12
  {
13
- "command": "g @nx/expo:component mylib/my-component --name my-component --classComponent",
14
- "description": "Generate a class component in the mylib library"
13
+ "description": "Generate a component with the exported symbol different from the file name. It results in the component `Custom` at `mylib/src/foo.tsx`",
14
+ "command": "nx g @nx/expo:component mylib/src/foo --name=custom"
15
+ },
16
+ {
17
+ "description": "Generate a class component at `mylib/src/foo.tsx`",
18
+ "command": "nx g @nx/expo:component mylib/src/foo --classComponent"
15
19
  }
16
20
  ],
17
21
  "properties": {
18
22
  "path": {
19
23
  "type": "string",
20
- "description": "Path where the component will be generated.",
24
+ "description": "The file path to the component without the file extension. Relative to the current working directory.",
21
25
  "$default": {
22
26
  "$source": "argv",
23
27
  "index": 0
24
28
  },
25
- "x-prompt": "Where should the component be generated?",
26
- "x-priority": "important"
29
+ "x-prompt": "What is the component file path?"
27
30
  },
28
31
  "name": {
29
32
  "type": "string",
30
- "description": "The name of the component.",
31
- "x-prompt": "What name would you like to use for the component?"
33
+ "description": "The component symbol name. Defaults to the last segment of the file path."
32
34
  },
33
35
  "js": {
34
36
  "type": "boolean",
@@ -6,7 +6,7 @@
6
6
  "type": "object",
7
7
  "examples": [
8
8
  {
9
- "command": "g @nx/expo:lib mylib --directory=myapp",
9
+ "command": "nx g @nx/expo:lib mylib --directory=myapp",
10
10
  "description": "Generate libs/myapp/mylib"
11
11
  }
12
12
  ],