85 lines
2.9 KiB
JSON
85 lines
2.9 KiB
JSON
{
|
|
"name": "component",
|
|
"factory": "./src/generators/component/component#reactNativeComponentGenerator",
|
|
"schema": {
|
|
"cli": "nx",
|
|
"$id": "NxReactNativeApplication",
|
|
"$schema": "http://json-schema.org/schema",
|
|
"title": "Create a React Native Component for Nx",
|
|
"description": "Create a React native Component for Nx.",
|
|
"type": "object",
|
|
"examples": [
|
|
{
|
|
"command": "nx g @nx/react-native:component my-component --project=mylib",
|
|
"description": "Generate a component in the `mylib` library"
|
|
},
|
|
{
|
|
"command": "nx g @nx/react-native: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-prompt": "What is the name of the project for this component?"
|
|
},
|
|
"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
|
|
},
|
|
"skipTests": {
|
|
"type": "boolean",
|
|
"description": "When true, does not create `spec.ts` test files for the new component.",
|
|
"default": false
|
|
},
|
|
"directory": {
|
|
"type": "string",
|
|
"description": "Create the component under this directory (can be nested).",
|
|
"x-priority": "important"
|
|
},
|
|
"flat": {
|
|
"type": "boolean",
|
|
"description": "Create component at the source root rather than its own directory.",
|
|
"default": false
|
|
},
|
|
"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
|
|
},
|
|
"classComponent": {
|
|
"type": "boolean",
|
|
"alias": "C",
|
|
"description": "Use class components instead of functional component.",
|
|
"default": false
|
|
}
|
|
},
|
|
"required": ["name", "project"],
|
|
"presets": []
|
|
},
|
|
"description": "Create a React Native component.",
|
|
"aliases": ["c"],
|
|
"implementation": "/packages/react-native/src/generators/component/component#reactNativeComponentGenerator.ts",
|
|
"hidden": false,
|
|
"path": "/packages/react-native/src/generators/component/schema.json",
|
|
"type": "generator"
|
|
}
|