97 lines
3.8 KiB
JSON

{
"name": "component",
"factory": "./src/generators/component/component#expoComponentGeneratorInternal",
"schema": {
"cli": "nx",
"$id": "NxExpoComponent",
"$schema": "https://json-schema.org/schema",
"description": "Create a Expo Component for Nx.",
"type": "object",
"examples": [
{
"command": "g @nx/expo:component my-component --project=mylib",
"description": "Generate a component in the mylib library"
},
{
"command": "g @nx/expo:component my-component --project=mylib --classComponent",
"description": "Generate a class component in the mylib library"
}
],
"properties": {
"project": {
"type": "string",
"description": "The name of the project.",
"alias": "p",
"$default": { "$source": "projectName" },
"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 v18."
},
"name": {
"type": "string",
"description": "The name of the component.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the component?"
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"skipTests": {
"type": "boolean",
"description": "When true, does not create \"spec.ts\" test files for the new component.",
"default": false
},
"directory": {
"type": "string",
"description": "The directory at which to create the component file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the project root.",
"x-priority": "important"
},
"nameAndDirectoryFormat": {
"description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"flat": {
"type": "boolean",
"description": "Create component at the source root rather than its own directory.",
"default": false,
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. This option will be removed in Nx v18."
},
"export": {
"type": "boolean",
"description": "When true, the component is exported from the project index.ts (if it exists).",
"alias": "e",
"default": false,
"x-prompt": "Should this component be exported in the project?"
},
"pascalCaseFiles": {
"type": "boolean",
"description": "Use pascal case component file name (e.g. App.tsx).",
"alias": "P",
"default": false,
"x-deprecated": "Provide the `name` in pascal-case and use the `as-provided` format. This option will be removed in Nx v18."
},
"classComponent": {
"type": "boolean",
"alias": "C",
"description": "Use class components instead of functional component.",
"default": false
}
},
"required": ["name"],
"presets": []
},
"description": "Create a component",
"aliases": ["c"],
"implementation": "/packages/expo/src/generators/component/component#expoComponentGeneratorInternal.ts",
"hidden": false,
"path": "/packages/expo/src/generators/component/schema.json",
"type": "generator"
}