112 lines
4.5 KiB
JSON
112 lines
4.5 KiB
JSON
{
|
|
"name": "component",
|
|
"factory": "./src/generators/component/component#componentGeneratorInternal",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"cli": "nx",
|
|
"$id": "NxVueComponent",
|
|
"title": "Create a Vue Component",
|
|
"description": "Create a Vue Component for Nx.",
|
|
"type": "object",
|
|
"examples": [
|
|
{
|
|
"command": "nx g @nx/vue:component --directory=my-app/src/app/one --name=one --nameAndDirectoryFormat=as-provided --unitTestRunner=vitest",
|
|
"description": "Generate a component in the `my-app` application"
|
|
}
|
|
],
|
|
"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?",
|
|
"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"]
|
|
},
|
|
"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,
|
|
"x-priority": "internal"
|
|
},
|
|
"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 workspace root.",
|
|
"alias": "dir",
|
|
"x-priority": "important"
|
|
},
|
|
"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. It 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 desired `name` option instead and use the `as-provided` format. It will be removed in Nx v18."
|
|
},
|
|
"pascalCaseDirectory": {
|
|
"type": "boolean",
|
|
"description": "Use pascal case directory name (e.g. `App/App.tsx`).",
|
|
"alias": "R",
|
|
"default": false,
|
|
"x-deprecated": "Provide the desired `directory` option instead and use the `as-provided` format. It will be removed in Nx v18."
|
|
},
|
|
"routing": {
|
|
"type": "boolean",
|
|
"description": "Generate a library with routes."
|
|
},
|
|
"fileName": {
|
|
"type": "string",
|
|
"description": "Create a component with this file name."
|
|
},
|
|
"inSourceTests": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "When using Vitest, separate spec files will not be generated and instead will be included within the source files. Read more on the Vitest docs site: https://vitest.dev/guide/in-source.html"
|
|
},
|
|
"skipFormat": {
|
|
"description": "Skip formatting files.",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"x-priority": "internal"
|
|
}
|
|
},
|
|
"required": ["name"],
|
|
"presets": []
|
|
},
|
|
"aliases": ["c"],
|
|
"x-type": "component",
|
|
"description": "Create a Vue component.",
|
|
"implementation": "/packages/vue/src/generators/component/component#componentGeneratorInternal.ts",
|
|
"hidden": false,
|
|
"path": "/packages/vue/src/generators/component/schema.json",
|
|
"type": "generator"
|
|
}
|